Messy code identification method and device, equipment and storage medium
By obtaining the matching degree between the garbled character sequence and the character set, and combining it with a neural network model to automatically identify the target character set to which the garbled characters belong and decode them, the inconvenience and preset error problems of garbled character recognition in electronic devices are solved, and efficient character recognition is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-21
- Publication Date
- 2026-03-24
AI Technical Summary
In existing technologies, electronic devices require users to manually select a character set when recognizing garbled characters, or the characters cannot be recognized due to preset errors, resulting in inconvenience and low recognition efficiency.
By obtaining the matching degree of garbled character sequences and multiple character sets, a neural network model is used to identify the target character set to which the garbled characters belong, and decoding is performed based on the character set to achieve automatic identification and decoding.
It improves the convenience and efficiency of garbled character recognition, avoiding the inconvenience of users manually selecting character sets and the problem of characters not being recognized due to preset errors.
Smart Images

Figure CN121722952A_ABST
Abstract
Description
[0001] Case Analysis This application is a divisional application of Chinese Patent Application No. 202210275421.X, filed on March 21, 2022, entitled "Scrambled Character Recognition Method, Apparatus, Device and Storage Medium". Technical Field
[0002] This application relates to the field of electronic technology, and to, but is not limited to, a method, apparatus, device, and storage medium for identifying garbled characters. Background Technology
[0003] Electronic devices determine the character set used for a piece of text in two main ways: manual selection and preset selection. Users can manually select the character set, but this requires trying different sets, which is inconvenient. Furthermore, users cannot correct garbled characters displayed by electronic devices with incorrect preset character sets, such as some MP3 players and car stereos. Summary of the Invention
[0004] In view of this, embodiments of this application provide a method, apparatus, device, and storage medium for identifying garbled characters.
[0005] In a first aspect, embodiments of this application provide a garbled character recognition method, the method comprising: acquiring a first garbled character sequence to be recognized and at least one character set; the at least one character set including a first garbled character in the first garbled character sequence; determining a first target character set to which the first garbled character sequence belongs based on the matching degree between the at least one character set and the first garbled character sequence; and decoding the first garbled character sequence based on the first target character set to obtain a recognizable character sequence.
[0006] Secondly, embodiments of this application provide a garbled character recognition device, comprising: an acquisition module, configured to acquire a first garbled character sequence to be recognized and at least one character set; the at least one character set includes a first garbled character in the first garbled character sequence; a first determination module, configured to determine a first target character set to which the first garbled character sequence belongs based on the matching degree between the at least one character set and the first garbled character sequence; and a decoding module, configured to decode the first garbled character sequence based on the first target character set to obtain a recognizable character sequence.
[0007] Thirdly, embodiments of this application provide an electronic device, including a memory and a processor. The memory stores a computer program that can run on the processor, and the processor executes the program to implement the steps in the garbled character recognition method of embodiments of this application.
[0008] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps in the garbled character recognition method of embodiments of this application.
[0009] In this embodiment, the target character set to which the garbled character sequence belongs is determined based on the matching degree between the character set and the garbled character sequence. The garbled character sequence is then decoded based on the target character set to obtain a recognizable character sequence. This allows for a more convenient and intelligent determination of the target character set to which the garbled character sequence belongs, avoiding the inconvenience caused by users manually trying different character sets. It also avoids the problem of characters not being recognizable due to incorrect character set presets in electronic devices, thus improving character recognition efficiency. Attached Figure Description
[0010] Figure 1 This is a flowchart illustrating a garbled character recognition method according to an embodiment of this application; Figure 2 This is a flowchart illustrating another garbled character recognition method according to an embodiment of this application; Figure 3 This is a flowchart illustrating another method for identifying garbled characters according to an embodiment of this application; Figure 4 This is a flowchart illustrating another method for identifying garbled characters according to an embodiment of this application; Figure 5 A flowchart illustrating a garbled character recognition method is also provided as an embodiment of this application. Figure 6 A flowchart illustrating a garbled character recognition method is also provided as an embodiment of this application. Figure 7 A flowchart illustrating a garbled character recognition method is also provided as an embodiment of this application. Figure 8 A flowchart illustrating a garbled character recognition method is also provided as an embodiment of this application. Figure 9 This is a schematic diagram of the composition structure of a processing device according to an embodiment of this application; Figure 10 This is a schematic diagram of a hardware entity of the electronic device of this application. Detailed Implementation
[0011] The technical solution of this application will be further described in detail below with reference to the accompanying drawings and embodiments.
[0012] Figure 1 This is a flowchart illustrating a garbled character recognition method according to an embodiment of this application, as shown below. Figure 1 As shown, the method includes the following steps: Step 102: Obtain the first garbled character sequence to be identified and at least one character set; the at least one character set includes the first garbled character in the first garbled character sequence; Among them, garbled characters refer to a series of characters in a source file that are partially or completely unreadable because the electronic device uses an incompatible character set when opening the source file with a text editor; a garbled image can be an image containing garbled characters, which can be displayed by scanning with a camera, and the garbled characters can be identified from the garbled image displayed by the electronic device using OCR recognition technology; arranging the obtained garbled characters in order can generate a garbled character sequence; the garbled character sequence can be " "", "", "and" "wait.
[0013] Chinese and other languages that require multi-byte representation have various character sets, such as Simplified Chinese (GB2312), Chinese character encoding extension standard (GBK), Unicode, Traditional Chinese Big5 encoding (BIG5), Western European, Korean, and Japanese languages; the first garbled character in the first garbled character sequence can belong to one or more character sets.
[0014] Step 104: Based on the matching degree between at least one character set and the first garbled character sequence, determine the first target character set to which the first garbled character sequence belongs; In some embodiments, the matching degree can be measured by the number of characters in the character set that are identical to the first scrambled character in the first scrambled character sequence. For example, if the first scrambled character sequence includes 12 scrambled characters and 12 characters in a certain character set are identical to one of the scrambled characters, then the matching degree between the character set and the first scrambled character sequence can be 100%. If the first scrambled character sequence includes 20 scrambled characters and one character in a certain character set is identical to one of the scrambled characters, then the matching degree between the character set and the first scrambled character sequence can be 5%. The first target character set can be determined based on the matching degree between the character set and the first scrambled character sequence.
[0015] In some embodiments, a character set can be selected in a preset order, and the characters in the character set can be matched with the first garbled characters until all the first garbled characters appear in a certain character set, or a certain first garbled character appears only in a character set. Then the character set can be determined as the first target character set to which the first garbled character sequence belongs.
[0016] For example, the first garbled character sequence is " In the case of "", the first garbled character " Match with characters in the character set, if " If the first garbled character sequence appears only in the character set "GBK", then the first target character set to which it belongs is "GBK"; if it appears only in the character set "GBK", then the first target character set to which the first garbled character sequence ...". "If it appears in multiple first candidate character sets, then the first garbled character can be identified." Match with characters in the first candidate character set, if " If a character appears in multiple second candidate character sets (which are subsets of the first candidate character set), then the first garbled character can be identified. Match the characters in the second candidate character set until a first garbled character appears in only one character set. Then, determine that character set as the first target character set to which the first garbled character sequence belongs.
[0017] Step 106: Based on the first target character set, decode the first garbled character sequence to obtain a recognizable character sequence.
[0018] Among them, recognizable characters are those converted from garbled characters. Garbled characters generally do not conform to the grammatical structure of the corresponding character set or have semantic errors; recognizable character sequences are generally semantically correct and conform to the grammatical structure of the corresponding character set. Assuming the first target character set is the character set "GBK", the first garbled character sequence " Decoding yields the recognizable character sequence corresponding to the first garbled character sequence: "Spring slumber is unaware of dawn, everywhere one hears birds singing."
[0019] In this embodiment, the target character set to which the garbled character sequence belongs is determined based on the matching degree between the character set and the garbled character sequence. The garbled character sequence is then decoded based on the target character set to obtain a recognizable character sequence. This allows for a more convenient and intelligent determination of the target character set to which the garbled character sequence belongs, avoiding the inconvenience caused by users manually trying different character sets. It also avoids the problem of characters not being recognizable due to incorrect character set presets in electronic devices, thus improving character recognition efficiency.
[0020] In some embodiments, such as Figure 2 As shown, step 104, "determining the first target character set to which the first garbled character sequence belongs based on the matching degree between at least one character set and the first garbled character sequence," can be achieved through the following steps 141 and 142: Step 141: From at least one character set, determine the first reference character set that has the highest matching degree with the first garbled character sequence; First, determine the number of first garbled characters in the character set. Then, determine the character set that contains the most first garbled characters in the first garbled character sequence as the first reference character set with the highest matching degree with the first garbled character sequence.
[0021] Step 142: Determine the first reference character set as the first target character set to which the first garbled character sequence belongs.
[0022] In this embodiment of the application, by determining the first reference character set with the highest matching degree to the garbled character sequence as the first target character set to which the first garbled character sequence belongs, the character set to which the garbled character sequence belongs can be determined more accurately.
[0023] In some embodiments, such as Figure 3 As shown, the method also includes: Step 103: Based on the trained first neural network model and the first garbled character sequence, determine the first target character set to which the first garbled character sequence belongs; The first neural network model, which has been trained, is obtained by training the initial neural network model based on the second target character set to which the second garbled character belongs; the first target character set and the second target character set are character sets in at least one character set.
[0024] In one embodiment, a supervised learning algorithm can be used to train an initial neural network model using training samples, which consist of a second garbled character and the expected output (the second target character set to which the second garbled character belongs).
[0025] In this embodiment, the character set to which the garbled character sequence belongs is determined based on a trained neural network model. This makes it easier and more intelligent to determine the target character set to which the garbled character sequence belongs, avoiding the inconvenience caused by users manually trying different character sets. It also avoids the problem of characters not being recognized due to the character set preset error of the electronic device, thus improving the efficiency of character recognition.
[0026] In some embodiments, such as Figure 4 As shown, step 106, "Decoding the first garbled character sequence based on the first target character set to obtain a recognizable character sequence," can be achieved through the following steps 161 and 162: Step 161: Based on the first target character set, determine the first internal code value sequence corresponding to the first garbled character sequence; the first target character set stores the garbled characters and their corresponding internal code values; Among them, the internal code refers to the binary character encoding used in the computer Chinese character system, which is the exchange code for communicating between input, output, and the system platform. Through the internal code, the purpose of general and efficient text transmission can be achieved. For example, the American Standard Code for Information Interchange (ASCII); in a character set, the internal code value and the corresponding character can be stored. The internal code values corresponding to the same character are different in different character sets. For example, for the character "你好", the internal code value corresponding to it in the GBK character set is "C4E3BAC3", and in the Unicode character set, it is "4F60597D"; the characters corresponding to the same internal code value are also different in different character sets. For example, the characters displayed by the internal code value "662577204E0D89C96653FF0C5904590495FB557C9E1F3002" in different character sets are shown in Table 1 below.
[0027] Table 1
[0028] Step 162: Decode the first internal code value sequence to obtain a recognizable character sequence.
[0029] Among them, by decoding the first internal code value sequence "662577204E0D89C96653FF0C5904590495FB557C9E1F3002", a recognizable character sequence "春眠不觉晓,处处闻啼鸟。" can be obtained. In the embodiments of the present application, by based on the correspondence between the internal code value and the character in the character set, the internal code value sequence corresponding to the garbled character sequence is determined, so that the internal code value sequence corresponding to the garbled character sequence can be determined more accurately and efficiently.
[0030] In some embodiments, as Figure 5 shown, step 162 "Decode the first internal code value sequence to obtain a recognizable character sequence" can be implemented through the following step 1621 and step 1622: Step 1621: Determine the third target character set to which the first internal code value in the first internal code value sequence belongs; recognizable characters and the corresponding internal code values are stored in the third target character set; Among them, the character set to which the first internal code value sequence "662577204E0D89C96653…” belongs can be Unicode.
[0031] Step 1622: Based on the third target character set, determine the recognizable character sequence corresponding to the first internal code value sequence.
[0032] Among them, the recognizable characters corresponding to the first internal code values in the first internal code value sequence can be sequentially searched from the third target character set, and the recognizable character sequence can be generated in sequence. For example, it is determined that the recognizable character corresponding to the first internal code value "6625" is "春", the recognizable character corresponding to the first internal code value "7720" is "眠", the recognizable character corresponding to the first internal code value "4E0D" is "不"..., the recognizable character corresponding to the first internal code value "3002" is "。", and the recognizable characters are generated in sequence to form the recognizable character sequence "春眠不觉晓,处处闻啼鸟。".
[0033] In the embodiments of the present application, by first determining the third target character set to which the internal code value in the internal code value sequence corresponding to the garbled character sequence belongs, and then searching for the recognizable character corresponding to the internal code value from the third target character set, the recognizable character sequence corresponding to the garbled character sequence can be determined more accurately and conveniently.
[0034] In some embodiments, such as Figure 6 shown, step 1621 "determine the third target character set to which the first internal code value in the first internal code value sequence belongs" can be implemented through the following steps 16211a and step 16212a: Step 16211a: Determine the second reference character sequence corresponding to the first internal code value sequence in at least one character set from at least one character set; Step 16122a: Determine the character set in which the second reference character satisfies the grammatical structure of the corresponding character set as the third target character set to which the first internal code value sequence belongs.
[0035] Among them, sentence components can form a certain grammatical structure. Sentence components can include subject, predicate, object, attributive, adverbial, complement, etc.; the grammatical structures of different character sets are different. Therefore, the character sequences corresponding to different character sets need to conform to the grammatical structures of the character sets to which they belong. For example, the grammatical structure of the character set of simplified Chinese can include subject-predicate phrases, verb-object phrases, modifier-head phrases, complement phrases, and coordinate phrases, etc.; the grammatical structure of Japanese can include subject-predicate structure, subject-object-predicate structure, and subject-complement-predicate structure, etc.; it can be determined whether the character set is the third target character set to which the first internal code value sequence belongs according to whether the second reference character sequence corresponding to the first internal code value sequence in different character sets conforms to the grammatical structure of the character set to which it belongs.
[0036] In some embodiments, semantic analysis can also be performed on the second reference character sequence to determine whether there are semantic errors in the second reference character sequence, and the character set corresponding to the second reference character sequence without semantic errors is determined as the third target character set.
[0037] In some embodiments, the first internal code value sequence may also be analyzed first. For example, if there are two adjacent identical internal code values "5904" in the first internal code value sequence, then the second reference character sequence may be further analyzed. When the two second reference characters at the corresponding positions in the second reference character sequence are the same, the character set corresponding to the second reference character sequence is determined as the third target character set. For example, in the character set "Unicode", the characters corresponding to the internal code values "59045904" at two adjacent positions are "处处", then the character set "Unicode" can be determined as the third target character set to which the first internal code value "662577204E0D89C96653…" belongs.
[0038] In the embodiments of the present application, since the recognizable character sequence converted from the garbled character sequence should satisfy the grammatical structure, by determining the character set where the second reference character sequence that satisfies the grammatical structure is located as the third target character set, the third target character set to which the first internal code value sequence belongs can be determined more accurately.
[0039] In some embodiments, as Figure 7 shown, step 1621 "determine the third target character set to which the first internal code value in the first internal code value sequence belongs" can be implemented through the following step 16211b: Step 16211b: Based on the trained second neural network model and the first internal code value sequence, determine the third target character set to which the first internal code value sequence belongs; Among them, the trained second neural network model is obtained by training the initial neural network model based on the second internal code value sequence and the fourth target character set to which the second internal code value sequence belongs; the second internal code value sequence satisfies the grammatical structure of the fourth target character set.
[0040] In one embodiment, a supervised learning algorithm can be used to train the initial neural network model using training samples. The training samples are composed of the second internal code value sequence and the expected output (the fourth target character set to which the second internal code value sequence belongs). Since the recognizable character sequence corresponding to the first internal code value sequence should satisfy the grammatical structure, and the trained second neural network model is obtained by training the second internal code value sequence that satisfies the grammatical structure of the fourth target character set and the fourth target character set, the trained second neural network model can determine the third target character set to which the first internal code value sequence that satisfies the grammatical structure belongs.
[0041] In one embodiment, the second internal code value sequence may also satisfy the semantic standard of the fourth target character set, then the trained second neural network model can determine the third target character set to which the first internal code value sequence belongs when the character sequence corresponding to the first internal code value sequence satisfies the grammatical structure and the semantic standard.
[0042] In the embodiments of the present application, by using a trained neural network model to determine the character set to which the internal code value sequence belongs, it is possible to more conveniently and intelligently determine the target character set to which the internal code value sequence belongs. Then, according to the correspondence between the internal code value and the character in the target character set, the internal code value is converted into a recognizable character; this avoids the inconvenience caused by the user manually trying each character set, and also avoids the problem of unrecognizable characters caused by incorrect presetting of the character set of the electronic device, thus improving the character recognition efficiency.
[0043] Due to historical reasons, there are multiple character sets for languages such as Chinese that require multi-byte representation, such as GB2312, GBK, Unicode, etc. The internal code refers to the binary character encoding used in the computer Chinese system, which is the exchange code for communicating between input, output, and the system platform. Through the internal code, the purpose of universal and efficient text transmission can be achieved. For a piece of text, the internal code values are different for different character sets. For example, for the text "你好", the internal code value in GBK is: C4E3BAC3, and the internal code value in Unicode is: 4F60597D. When an electronic device displays such text, it needs to correctly identify its encoding character set and decode it, otherwise it may display garbled characters.
[0044] For example, for a piece of text with internal code values like: 662577204E0D89C96653FF0C5904590495FB557C9E1F3002, when the device "interprets" it with different character sets, the displayed text is as shown in Table 1 below: Table 1
[0045] There are generally two ways for an electronic device to judge the character set used for a piece of text: manual selection and presetting. For an electronic device where the user can manually select the character set, the user needs to try each character set, which is very inconvenient; for the garbled characters displayed by an electronic device with incorrect presetting, the user has no way to modify them, such as some mp3 devices, car stereos, etc.
[0046] To address the above problems and the deficiencies of related solutions, this solution proposes: collecting a picture of the garbled text displayed through the camera of a mobile device (such as a mobile phone), performing optical character recognition (OCR) on it to recognize the garbled text, and using a machine learning algorithm to recognize the currently used character set corresponding to the garbled text, so as to convert the garbled text into the corresponding internal code value based on the currently used character set. Then, use a machine learning algorithm to recognize the original character set corresponding to the internal code value, and decode and display the internal code value based on the original character set to obtain recognizable text.
[0047] The advantage of adopting this solution is that for devices that cannot change their encoding set and are already displaying garbled text, the original text can be correctly identified and the garbled text can be quickly displayed as correct readable text, without the user having to try to modify the encoding set (i.e., character set) one by one.
[0048] Figure 8 This is a flowchart illustrating another method for identifying garbled characters according to an embodiment of this application, as shown below. Figure 8 As shown, the method includes the following steps: Step 801: Scan the garbled image displayed on the electronic device using the mobile phone camera; Step 802: OCR identifies the garbled text in the garbled image; Among them, garbled text is a type of garbled character, and the identified garbled text can form the first garbled character sequence "". ".
[0049] Step 803: Identify the garbled character set containing the garbled text using machine learning algorithms or models; The garbled character set, also known as the first target character set, can be input into a trained first neural network model. The first neural network model can output the first target character set containing the garbled characters in the first garbled character sequence. The trained first neural network model is obtained by training the initial neural network model based on the second garbled character and the second target character set to which the second garbled character belongs. The first garbled character sequence is... The corresponding garbled character set could be GBK.
[0050] Step 804: Find the internal code value (also known as the encoding value) corresponding to each garbled character according to the garbled character set; The garbled character set can store garbled characters and their corresponding internal code values; the first internal code value sequence "662577204E0D89C96653…" corresponding to the first garbled character sequence can be found through the garbled character set.
[0051] Step 805: Infer the original character set of this internal code value using machine learning algorithms or models; Among them, the original character set, also known as the third target character set, can input the sequence of internal code values into the trained second neural network model, and the second neural network model can output the third target character set where the internal code values in the sequence of internal code values are located; the trained second neural network model is obtained by training the initial neural network model based on the second sequence of internal code values and the fourth target character set to which the second sequence of internal code values belongs. The second sequence of internal code values satisfies the syntax structure of the fourth target character set. The original character set corresponding to the first sequence of internal code values "662577204E0D89C96653..." can be Unicode.
[0052] Step 806: Decode this sequence of internal code values according to the original character set and display the corresponding recognizable text.
[0053] Among them, the original character set can correspondingly store recognizable characters and the internal code values corresponding to the recognizable characters; the recognizable character "Spring slumber runs on, unaware of dawn..." corresponding to the first sequence of internal code values "662577204E0D89C96653..." can be found through the original character set.
[0054] It should be noted that in the embodiments of the present application, if the above-mentioned garbled code recognition method is implemented in the form of software function modules and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiments of the present application, in essence or the part that contributes to the related technology, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a mobile phone, a tablet computer, a desktop computer, a personal digital assistant, etc.) to execute all or part of the methods of the various embodiments of the present application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROMs), magnetic disks, or optical discs that can store program codes. In this way, the embodiments of the present application are not limited to any specific combination of hardware and software.
[0055] Based on the embodiments of the method, the embodiments of the present application provide a garbled code recognition device. The device includes each module included and can be implemented by a processor in a computer device; of course, it can also be implemented by specific logic circuits; during the implementation process, the processor can be a central processing unit (CPU), a microprocessor unit (MPU), a digital signal processor (DSP), or a field programmable gate array (FPGA), etc.
[0056] Figure 9 This is a schematic diagram of the composition structure of a garbled character recognition device according to an embodiment of this application, as shown below. Figure 9 As shown, the device 900 includes an acquisition module 901, a determination module 902, and a decoding module 903, wherein: The acquisition module 901 is used to acquire a first garbled character sequence to be identified and at least one character set; the at least one character set includes the first garbled character in the first garbled character sequence. The first determining module 902 is used to determine the first target character set to which the first garbled character sequence belongs based on the matching degree between at least one character set and the first garbled character sequence. The decoding module 903 is used to decode the first garbled character sequence based on the first target character set to obtain a recognizable character sequence.
[0057] In some embodiments, the first determining module includes a first determining submodule, configured to determine a first reference character set that has the highest matching degree with the first garbled character sequence from at least one character set; and a second determining submodule, configured to determine the first reference character set as the first target character set to which the first garbled character sequence belongs.
[0058] In some embodiments, the apparatus further includes: a second determining module, configured to determine a first target character set to which the first garbled character sequence belongs based on a trained first neural network model and a first garbled character sequence; wherein the trained first neural network model is trained on an initial neural network model based on a second garbled character and a second target character set to which the second garbled character belongs.
[0059] In some embodiments, the decoding module includes: a third determining submodule, configured to determine a first internal code value sequence corresponding to a first garbled character sequence based on a first target character set; the first target character set stores garbled characters and their corresponding internal code values; and a decoding submodule, configured to decode the first internal code value sequence to obtain a recognizable character sequence.
[0060] In some embodiments, the decoding submodule includes: a first determining unit, configured to determine a third target character set to which the first internal code value in the first internal code value sequence belongs; the third target character set stores identifiable characters and their corresponding internal code values; and a second determining unit, configured to determine an identifiable character sequence corresponding to the first internal code value sequence based on the third target character set.
[0061] In some embodiments, the first determining unit includes: a first determining subunit, configured to determine from at least one character set that the first internal code value sequence corresponds to a second reference character sequence in at least one character set; and a second determining subunit, configured to determine the character set to which the second reference character satisfies the syntax structure of the corresponding character set as the third target character set to which the first internal code value sequence belongs.
[0062] In some embodiments, the first determining unit includes: a third determining subunit, configured to determine the third target character set to which the first internal code value sequence belongs based on a trained second neural network model and the first internal code value sequence; wherein the trained second neural network model is obtained by training an initial neural network model based on the second internal code value sequence and the fourth target character set to which the second internal code value sequence belongs; and the second internal code value sequence satisfies the grammatical structure of the fourth target character set.
[0063] The descriptions of the above device embodiments are similar to those of the above method embodiments, and have similar beneficial effects. For technical details not disclosed in the device embodiments of this application, please refer to the descriptions of the method embodiments of this application for understanding.
[0064] Correspondingly, embodiments of this application provide an electronic device, Figure 10 This is a schematic diagram of a hardware entity of an electronic device according to an embodiment of this application, such as... Figure 10 As shown, the hardware entity of the device 1000 includes a memory 1001 and a processor 1002. The memory 1001 stores a computer program that can run on the processor 1002. When the processor 1002 executes the program, it implements the steps in the garbled character recognition method in the above embodiments.
[0065] The memory 1001 is configured to store instructions and applications executable by the processor 1002, and can also cache data to be processed or already processed by the processor 1002 and the various modules in the device 1000 (e.g., image data, audio data, voice communication data and video communication data), which can be implemented by flash memory or random access memory (RAM).
[0066] Correspondingly, embodiments of this application provide a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps in the garbled character recognition method described above.
[0067] It should be noted that the descriptions of the storage medium and device embodiments above are similar to those of the method embodiments above, and have similar beneficial effects as the device embodiments. For technical details not disclosed in the storage medium and method embodiments of this application, please refer to the descriptions of the device embodiments of this application for understanding.
[0068] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It should be understood that in the various embodiments of this application, the sequence numbers of the above-described processes do not imply a sequential order of execution; the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. The sequence numbers of the above-described embodiments are merely descriptive and do not represent the superiority or inferiority of the embodiments.
[0069] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0070] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or units can be electrical, mechanical, or other forms.
[0071] The units described above as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; they may be located in one place or distributed across multiple network units; some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, the functional units in the embodiments of this application may all be integrated into one processing unit, or each unit may be a separate unit, or two or more units may be integrated into one unit; the integrated unit may be implemented in hardware or in a combination of hardware and software functional units.
[0072] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, read-only memory (ROM), magnetic disks, or optical disks. Alternatively, if the integrated units of this application are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, or the parts that contribute to the related technology, can be embodied in the form of software products. These computer software products are stored in a storage medium and include several instructions to cause computer devices (which may be mobile phones, tablets, desktops, personal digital assistants, navigators, digital phones, video phones, televisions, sensing devices, etc.) to execute all or part of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROMs, magnetic disks, or optical disks.
[0073] The methods disclosed in the several method embodiments provided in this application can be arbitrarily combined to obtain new method embodiments without conflict. The features disclosed in the several product embodiments provided in this application can be arbitrarily combined to obtain new product embodiments without conflict. The features disclosed in the several method or device embodiments provided in this application can be arbitrarily combined to obtain new method or device embodiments without conflict.
[0074] The above are merely embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for identifying garbled characters, the method comprising: Obtain the first garbled character sequence to be identified and at least one character set; The at least one character set includes the first garbled character in the first garbled character sequence; Based on the matching degree between at least one of the character sets and the first garbled character sequence, determine the first target character set to which the first garbled character sequence belongs; Based on the first target character set, determine the first internal code value sequence corresponding to the first garbled character sequence; the first target character set stores garbled characters and their corresponding internal code values; The first internal code value sequence is decoded to obtain a recognizable character sequence.
2. The method according to claim 1, wherein determining the first target character set to which the first garbled character sequence belongs based on the matching degree between at least one of the character sets and the first garbled character sequence comprises: From at least one of the character sets, determine a first reference character set that has the highest matching degree with the first garbled character sequence; The first reference character set is determined as the first target character set to which the first garbled character sequence belongs.
3. The method according to claim 1, further comprising: Based on the trained first neural network model and the first garbled character sequence, determine the first target character set to which the first garbled character sequence belongs; The trained first neural network model is obtained by training the initial neural network model based on the second garbled character and the second target character set to which the second garbled character belongs.
4. The method according to claim 1, wherein decoding the first internal code value sequence to obtain a recognizable character sequence comprises: Determine the third target character set to which the first internal code value in the first internal code value sequence belongs; The third target character set stores recognizable characters and their corresponding internal code values; Based on the third target character set, determine the recognizable character sequence corresponding to the first internal code value sequence.
5. The method according to claim 4, wherein determining the third target character set to which the first internal code value sequence belongs includes: From at least one of the character sets, determine that the first internal code value sequence corresponds to a second reference character sequence in at least one of the character sets; The character set whose second reference character satisfies the syntax structure of the corresponding character set is determined as the third target character set to which the first internal code value sequence belongs.
6. The method according to claim 4, wherein determining the third target character set to which the first internal code value sequence belongs includes: Based on the trained second neural network model and the first internal code value sequence, determine the third target character set to which the first internal code value sequence belongs; The trained second neural network model is obtained by training the initial neural network model based on the second internal code value sequence and the fourth target character set to which the second internal code value sequence belongs; the second internal code value sequence satisfies the grammatical structure of the fourth target character set.
7. A garbled character recognition device, the device comprising: The acquisition module is used to acquire the first garbled character sequence to be identified and at least one character set; The at least one character set includes the first garbled character in the first garbled character sequence; The first determining module is used to determine the first target character set to which the first garbled character sequence belongs based on the matching degree between at least one of the character sets and the first garbled character sequence; The third determining module is used to determine the first internal code value sequence corresponding to the first garbled character sequence based on the first target character set; the first target character set stores garbled characters and their corresponding internal code values; The decoding submodule is used to decode the first internal code value sequence to obtain a recognizable character sequence.
8. An electronic device comprising a memory and a processor, the memory storing a computer program executable on the processor, the processor executing the program to implement the steps of the garbled character recognition method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the garbled character recognition method according to any one of claims 1 to 6.