Chinese character recognition error correction method and device, computer readable medium and electronic equipment

文档序号:1545156 发布日期:2020-01-17 浏览:4次 中文

阅读说明:本技术 汉字识别纠错方法、装置、计算机可读介质及电子设备 (Chinese character recognition error correction method and device, computer readable medium and electronic equipment ) 是由 周多友 王长虎 于 2019-09-24 设计创作,主要内容包括:本公开涉及一种汉字识别纠错方法、装置、计算机可读介质及电子设备。方法包括:接收客户端发送的汉字纠错请求,汉字纠错请求包括待纠错汉字;确定待纠错汉字的编码,编码用于表征所述待纠错汉字所包含的部件和部件间结构关系,部件包括偏旁和部首;根据汉字信息库中存储的多个预设汉字对应的编码,及待纠错汉字的编码,从多个预设汉字中确定出与待纠错汉字相似的目标汉字,其中,多个预设汉字不包括待纠错汉字;将目标汉字发送至客户端,以由客户端进行展现。由此,根据各汉字相应编码确定出的与待纠错汉字相似的目标汉字与待纠错汉字存在相关性,这样,将与上述待纠错汉字存在相关性的目标汉字用于该待纠错汉字的纠错,能够提升纠错准确度和纠错效率。(The disclosure relates to a Chinese character recognition error correction method, a device, a computer readable medium and an electronic device. The method comprises the following steps: receiving a Chinese character error correction request sent by a client, wherein the Chinese character error correction request comprises Chinese characters to be corrected; determining the code of the Chinese character to be corrected, wherein the code is used for representing the structural relationship between components and parts contained in the Chinese character to be corrected, and the components comprise components and radicals; determining a target Chinese character similar to the Chinese character to be corrected from the plurality of preset Chinese characters according to codes corresponding to the plurality of preset Chinese characters stored in the Chinese character information base and the code of the Chinese character to be corrected, wherein the plurality of preset Chinese characters do not include the Chinese character to be corrected; and sending the target Chinese characters to the client side to be displayed by the client side. Therefore, the target Chinese character which is similar to the Chinese character to be corrected and determined according to the corresponding code of each Chinese character is relevant to the Chinese character to be corrected, so that the target Chinese character which is relevant to the Chinese character to be corrected is used for correcting the Chinese character to be corrected, and the correction accuracy and the correction efficiency can be improved.)

1. A Chinese character recognition error correction method is characterized by comprising the following steps:

receiving a Chinese character error correction request sent by a client, wherein the Chinese character error correction request comprises Chinese characters to be corrected;

determining the codes of the Chinese characters to be corrected, wherein the codes are used for representing components and structural relations among the components contained in the Chinese characters to be corrected, and the components comprise components and radicals;

determining a target Chinese character similar to the Chinese character to be corrected from a plurality of preset Chinese characters according to codes corresponding to the preset Chinese characters stored in a Chinese character information base and the codes of the Chinese characters to be corrected, wherein the preset Chinese characters do not comprise the Chinese characters to be corrected;

and sending the target Chinese characters to the client side to be displayed by the client side.

2. The method of claim 1, wherein the code corresponding to each Chinese character in the Chinese character information base is determined by:

aiming at each Chinese character in the Chinese character information base, acquiring components contained in the Chinese character and structural relations among the components;

modifying element values corresponding to the parts in a first coding sequence into first bit values aiming at each part to obtain a second coding sequence, wherein the first coding sequence is a binary bit sequence with each element value being a second bit value, each part or structural relations among the parts in a part structure set respectively correspond to each element in the first coding sequence one by one, and the part structure set is a set formed by the parts and the structural relations among the parts contained in all Chinese characters in the Chinese character information base;

and modifying the element values corresponding to the structural relationship among the parts in the second coding sequence into the first bit values aiming at the structural relationship among the parts to obtain the codes corresponding to the Chinese characters.

3. The method of claim 1, wherein the code corresponding to each Chinese character in the Chinese character information base is determined by:

aiming at each Chinese character in the Chinese character information base, acquiring components contained in the Chinese character and structural relations among the components;

modifying element values corresponding to the parts in a third coding sequence into first bit values aiming at each part to obtain a fourth coding sequence, wherein the third coding sequence is a binary bit sequence with each element value being a second bit value, each part in a part set is respectively in one-to-one correspondence with each element in the third coding sequence, and the part set is a set formed by parts contained in all Chinese characters in the Chinese character information base;

modifying element values in a fifth coding sequence corresponding to the structural relationship among the parts into the first bit values according to the structural relationship among the parts to obtain a sixth coding sequence, wherein the fifth coding sequence is a binary bit sequence with all the element values being the second bit values, the structural relationship among the parts in a structural set respectively corresponds to all the elements in the fifth coding sequence one by one, and the structural set is a set formed by the structural relationship among the parts contained in all the Chinese characters in the Chinese character information base;

and splicing the fourth coding sequence and the sixth coding sequence to obtain the codes corresponding to the Chinese characters.

4. The method according to any one of claims 1-3, wherein the determining a target Chinese character similar to the Chinese character to be corrected from the plurality of preset Chinese characters according to the codes corresponding to the plurality of preset Chinese characters stored in the Chinese character information base and the codes of the Chinese characters to be corrected comprises:

calculating the similarity between the codes corresponding to the preset Chinese characters and the codes of the Chinese characters to be corrected according to each preset Chinese character;

and if the preset Chinese character corresponding to the similarity is determined to be similar to the Chinese character to be corrected according to the similarity, determining the preset Chinese character corresponding to the similarity as a target Chinese character.

5. A Chinese character recognition error correction device is characterized by comprising:

the system comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving a Chinese character error correction request sent by a client, and the Chinese character error correction request comprises Chinese characters to be corrected;

the first determining module is used for determining the codes of the Chinese characters to be corrected, wherein the codes are used for representing the structural relationship between components and parts contained in the Chinese characters to be corrected, and the components comprise components and radicals;

the second determining module is used for determining a target Chinese character similar to the Chinese character to be corrected from the plurality of preset Chinese characters according to codes corresponding to the plurality of preset Chinese characters stored in a Chinese character information base and the code of the Chinese character to be corrected determined by the first determining module, wherein the plurality of preset Chinese characters do not comprise the Chinese character to be corrected;

and the sending module is used for sending the target Chinese characters determined by the second determining module to the client side so as to be displayed by the client side.

6. The apparatus of claim 5, wherein the code corresponding to each Chinese character in the Chinese character information library is determined by a coding apparatus, wherein the coding apparatus comprises:

the acquisition module is used for acquiring components contained in the Chinese characters and structural relations among the components aiming at each Chinese character in the Chinese character information base;

a third determining module, configured to modify, for each component obtained by the obtaining module, an element value corresponding to the component in a first coding sequence into a first bit value to obtain a second coding sequence, where the first coding sequence is a binary bit sequence in which each element value is a second bit value, and each component or structural relationships among components in a component structure set correspond to each element in the first coding sequence one to one, and the component structure set is a set formed by components and structural relationships among components included in all chinese characters in the chinese character information base;

and a fourth determining module, configured to modify, for each inter-component structural relationship obtained by the obtaining module, an element value corresponding to the inter-component structural relationship in the second coding sequence to the first bit value, so as to obtain a code corresponding to the Chinese character.

7. The apparatus of claim 5, wherein the code corresponding to each Chinese character in the Chinese character information library is determined by a coding apparatus, wherein the coding apparatus comprises:

the acquisition module is used for acquiring components contained in the Chinese characters and structural relations among the components aiming at each Chinese character in the Chinese character information base;

a fifth determining module, configured to modify, for each component obtained by the obtaining module, an element value corresponding to the component in a third coding sequence into a first bit value to obtain a fourth coding sequence, where the third coding sequence is a binary bit sequence in which each element value is a second bit value, each component in a component set corresponds to each element in the third coding sequence one to one, and the component set is a set formed by components included in all chinese characters in the chinese character information base;

a sixth determining module, configured to modify, for each inter-component structural relationship obtained by the obtaining module, an element value corresponding to the inter-component structural relationship in a fifth coding sequence into the first bit value, so as to obtain a sixth coding sequence, where the fifth coding sequence is a binary bit sequence in which each element value is the second bit value, structural relationships among components in a structure set are respectively in one-to-one correspondence with each element in the fifth coding sequence, and the structure set is a set formed by structural relationships among components included in all chinese characters in the chinese character information base;

and the splicing module is used for splicing the fourth coding sequence obtained by the fifth determining module and the sixth coding sequence obtained by the sixth determining module to obtain the codes corresponding to the Chinese characters.

8. The apparatus of any of claims 5-7, wherein the second determining module comprises:

the calculation submodule is used for calculating the similarity between the codes corresponding to the preset Chinese characters and the codes of the Chinese characters to be corrected aiming at each preset Chinese character;

and the determining submodule is used for determining the preset Chinese character corresponding to the similarity as the target Chinese character if the preset Chinese character corresponding to the similarity is determined to be similar to the Chinese character to be corrected according to the similarity obtained by the calculating submodule.

9. A computer-readable medium, on which a computer program is stored, characterized in that the program, when being executed by processing means, carries out the steps of the method of any one of claims 1-4.

10. An electronic device, comprising:

a storage device having a computer program stored thereon;

processing means for executing the computer program in the storage means to carry out the steps of the method according to any one of claims 1 to 4.

Technical Field

The present disclosure relates to the field of image character recognition, and in particular, to a method and an apparatus for Chinese character recognition and error correction, a computer readable medium, and an electronic device.

Background

At present, the encoding of the chinese characters mostly adopts a one-hot code (one-hot code) mode, so that 7445 chinese characters and graphic characters exist in a chinese character information base, and the dimension for representing the encoding of each chinese character and graphic character is seven thousand or more, which is a very large and bloated encoding mode. In addition, in this coding method, since there is no correlation between the chinese characters represented by the adjacent codes, it is not possible to know what the image shown in the original image is in the case of a recognition error, and it is very inconvenient to correct the recognized chinese characters.

Disclosure of Invention

This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.

In a first aspect, the present disclosure provides a method for identifying and correcting chinese characters, including:

receiving a Chinese character error correction request sent by a client, wherein the Chinese character error correction request comprises Chinese characters to be corrected;

determining the codes of the Chinese characters to be corrected, wherein the codes are used for representing components and structural relations among the components contained in the Chinese characters to be corrected, and the components comprise components and radicals;

determining a target Chinese character similar to the Chinese character to be corrected from a plurality of preset Chinese characters according to codes corresponding to the preset Chinese characters stored in a Chinese character information base and the codes of the Chinese characters to be corrected, wherein the preset Chinese characters do not comprise the Chinese characters to be corrected;

and sending the target Chinese characters to the client side to be displayed by the client side.

In a second aspect, the present disclosure provides a chinese character recognition and error correction apparatus, including:

the system comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving a Chinese character error correction request sent by a client, and the Chinese character error correction request comprises Chinese characters to be corrected;

the first determining module is used for determining the codes of the Chinese characters to be corrected, wherein the codes are used for representing the structural relationship between components and parts contained in the Chinese characters to be corrected, and the components comprise components and radicals;

the second determining module is used for determining a target Chinese character similar to the Chinese character to be corrected from the plurality of preset Chinese characters according to codes corresponding to the plurality of preset Chinese characters stored in a Chinese character information base and the code of the Chinese character to be corrected determined by the first determining module, wherein the plurality of preset Chinese characters do not comprise the Chinese character to be corrected;

and the sending module is used for sending the target Chinese characters determined by the second determining module to the client side so as to be displayed by the client side.

In a third aspect, the present disclosure provides a computer readable medium having stored thereon a computer program which, when executed by a processing apparatus, performs the steps of the method provided by the first aspect of the present disclosure.

In a fourth aspect, the present disclosure provides an electronic device comprising:

a storage device having a computer program stored thereon;

processing means for executing the computer program in the storage means to implement the steps of the method provided by the first aspect of the present disclosure.

In the technical scheme, after a Chinese character error correction request sent by a client is received, firstly, the codes of Chinese characters to be corrected contained in the request to be corrected are determined; then, according to codes corresponding to a plurality of preset Chinese characters stored in a Chinese character information base and codes of Chinese characters to be corrected, target Chinese characters similar to the Chinese characters to be corrected are determined from the preset Chinese characters; and finally, feeding the target Chinese character back to the client side to be displayed at the client side. Because the codes adopted by the Chinese characters in the method can represent the components contained in the corresponding Chinese characters and the structural relationship among the components, the same components or structures exist among the Chinese characters with similar codes. Therefore, the target Chinese character which is determined according to the corresponding codes of the Chinese characters and is similar to the Chinese character to be corrected has correlation with the Chinese character to be corrected, so that the target Chinese character which has correlation with the Chinese character to be corrected is used for correcting the Chinese character to be corrected, and the correction accuracy and the correction efficiency can be improved.

Additional features and advantages of the disclosure will be set forth in the detailed description which follows.

Drawings

The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and features are not necessarily drawn to scale. In the drawings:

FIG. 1 is a schematic diagram illustrating one implementation environment in accordance with an example embodiment.

FIG. 2 is a flow chart illustrating a method for Chinese character recognition error correction according to an exemplary embodiment.

FIG. 3 is a flow chart illustrating a method of encoding Chinese characters in accordance with an exemplary embodiment.

FIG. 4 is a flow chart illustrating a method of encoding Chinese characters according to another exemplary embodiment.

FIG. 5 is a flow chart illustrating a method of determining a target Chinese character in accordance with an exemplary embodiment.

Fig. 6 is a block diagram illustrating an apparatus for chinese character recognition error correction according to an exemplary embodiment.

Fig. 7 is a block diagram illustrating an encoding apparatus according to an example embodiment.

Fig. 8 is a block diagram illustrating an encoding apparatus according to another exemplary embodiment.

Fig. 9 is a block diagram illustrating a chinese character recognition error correction apparatus according to another exemplary embodiment.

FIG. 10 is a block diagram illustrating an electronic device in accordance with an example embodiment.

Detailed Description

Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.

It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.

The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.

It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.

It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.

The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.

FIG. 1 is a schematic diagram illustrating one implementation environment in accordance with an example embodiment. As shown in fig. 1, the implementation environment may include a server 100 and at least one client 200.

In the present disclosure, the server 100 is in communication connection with each client 200, wherein the two may communicate via a 2G network, a 3G network, a 4G network, bluetooth, WIFI, etc. to complete data transmission. After the image is subjected to Chinese character recognition, the client 200 may send one or more Chinese characters to be corrected, which are not recognized correctly, to the server 100, so that the server 100 provides a correction suggestion. In addition, the client 200 may be, for example, a smart phone, a tablet computer, or the like, and is not particularly limited in this disclosure.

Specifically, the server 100 may provide the error correction suggestion to the corresponding client 200 through steps 201 to 204 shown in fig. 2.

In step 201, a chinese character error correction request sent by a client is received, where the chinese character error correction request includes a chinese character to be error corrected.

In the present disclosure, after performing chinese character recognition on an image, when there is a recognition error, the client 200 may send a chinese character error correction request including one or more chinese characters to be error corrected to the server 100; the server 100 receives the chinese character correction request.

In step 202, the code of the Chinese character to be corrected is determined.

In the present disclosure, the above codes are used to represent components and structural relationships among components included in a chinese character to be corrected, where the components may include components and radicals, and the structural relationships among the components are to morphologically summarize the structure of the chinese character into an upper-lower structure, a left-right structure, and other structures (e.g., an upper-middle-lower structure, a left-middle-right structure, a full-enclosure structure, a half-enclosure structure, an insertion structure, a delta-shape structure, a single-body structure, etc.).

The codes corresponding to the Chinese characters are stored in the Chinese character information base, so that when the Chinese character error correction request sent by the client 200 is received through the step 201, the codes corresponding to the Chinese characters to be error corrected can be obtained by accessing the corresponding storage modules of the Chinese character information base.

In addition, in one embodiment, the code corresponding to each Chinese character in the Chinese character information base can be determined through steps 301 to 303 shown in FIG. 3.

In step 301, for each chinese character in the chinese character information base, the components included in the chinese character and the structural relationship between the components are obtained.

In the present disclosure, since the specific manner of obtaining the structural relationship between the components and the components is well known to those skilled in the art, the detailed description thereof is omitted here.

In step 302, for each component, the element value in the first code sequence corresponding to the component is modified to a first bit value, resulting in a second code sequence.

In this disclosure, the first coding sequence may be a binary bit sequence in which each element value is a second bit value, and each component or structural relationship among components in the component structure set corresponds to each element in the first coding sequence one to one (that is, the length of the first coding sequence is equal to the number of elements included in the component structure set), where the component structure set may be a set formed by components and structural relationships among components included in all chinese characters in the chinese character information library.

The first bit value is 1, and the second bit value is 0; alternatively, the first bit value is 0 and the second bit value is 1.

Illustratively, if 300 parts are included in all the chinese characters in the chinese character information library and 50 structural relationships are included in the chinese characters, the length of the first coding sequence is 350, where the 300 parts and 50 structural relationships are respectively in one-to-one correspondence with 350 elements in the first coding sequence.

In step 303, for each structural relationship between the components, the element value corresponding to the structural relationship between the components in the second coding sequence is modified into the first bit value, so as to obtain the code corresponding to the chinese character.

The following illustrates how each chinese character in the chinese character information base is encoded through the above steps 301 to 303.

Illustratively, the chinese character is "part", and the parts included in the chinese character obtained in step 301 are "vertical", "oral" and "", where the structural relationship of each part is left-right structure + top-bottom structure; then, element values corresponding to three parts of 'vertical', 'mouth', '' in the first coding sequence are modified into a first bit value (for example, 1) respectively, and a second coding sequence is obtained; next, the element values corresponding to the "left-right structure" and the "top-bottom structure" in the second coding sequence are modified to the first bit value (for example, 1), whereby the code corresponding to the "part" of the chinese character can be obtained.

Further, for example, the chinese character is "middle", the component included in the chinese character is "middle" obtained in step 301, and the component structure relationship is a single-body structure; then, modifying the element value corresponding to the component "middle" in the first code sequence into a first bit value (for example, 1) to obtain a second code sequence; next, the element value corresponding to the "one-body structure" in the second coding sequence is modified to the first bit value (for example, 1), so that the code corresponding to the "middle" Chinese character can be obtained.

In another embodiment, firstly, aiming at each Chinese character in a Chinese character information base, acquiring components contained in the Chinese character and structural relations among the components; then, aiming at the structural relationship among the components, modifying the element value corresponding to the structural relationship among the components in the first coding sequence into a first bit value to obtain a second coding sequence; finally, aiming at each part, modifying the element value corresponding to the part in the second coding sequence into a first bit value to obtain the code corresponding to the Chinese character.

In another embodiment, the code corresponding to each Chinese character in the Chinese character information base can be determined through steps 401 to 404 shown in FIG. 4.

In step 401, for each chinese character in the chinese character information base, the components included in the chinese character and the structural relationship between the components are obtained.

In step 402, for each part, the element value corresponding to the part in the third encoded sequence is modified to a first bit value, resulting in a fourth encoded sequence.

In this disclosure, the third coding sequence is a binary bit sequence in which each element value is a second bit value, and each component in the component set corresponds to each element in the third coding sequence one to one, where the component set is a set formed by components included in all chinese characters in the chinese character information base.

Illustratively, if there are 300 parts included in all the chinese characters in the chinese character information library, the length of the third encoding sequence is 300, where the 300 parts are respectively in one-to-one correspondence with 300 elements in the third encoding sequence.

In step 403, for each structural relationship between the components, the element value corresponding to the structural relationship between the components in the fifth coding sequence is modified into the first bit value, so as to obtain a sixth coding sequence.

In this disclosure, the fifth coding sequence is a binary bit sequence in which each element value is a second bit value, and the structural relationships among the parts in the structural set correspond to the elements in the fifth coding sequence one to one, where the structural set is a set formed by the structural relationships among the parts included in all the chinese characters in the chinese character information base.

Illustratively, 50 structural relationships among components included in all the chinese characters in the chinese character information library are present, and the length of the fifth encoding sequence is 50, where the 50 structural relationships among the components respectively correspond to 50 elements in the fifth encoding sequence one to one.

In step 404, the fourth coding sequence and the sixth coding sequence are spliced to obtain a code corresponding to the Chinese character.

In the present disclosure, after the fourth coding sequence is obtained in step 402 and the sixth coding sequence is obtained in step 403, the sixth coding sequence may be spliced to the tail of the fourth coding sequence, or the fourth coding sequence may be spliced to the tail of the sixth coding sequence, so as to obtain the code corresponding to the chinese character.

Note that, the step 403 may be executed before the step 402, may be executed after the step 402, may be executed simultaneously with the step 402, and is not particularly limited in the present disclosure.

The following illustrates how each Chinese character in the Chinese character information base is encoded through the above steps 401 to 404.

Illustratively, the chinese character is "part", and the parts included in the chinese character obtained in step 401 are "vertical", "oral" and "", where the structural relationship of each part is left-right structure + top-bottom structure; then, element values corresponding to three components of "vertical", "horizontal", "" in the third code sequence are modified to a first bit value (for example, 1) to obtain a fourth code sequence, and element values corresponding to "left and right structures" and "upper and lower structures" in the fifth code sequence are modified to a first bit value (for example, 1) to obtain a sixth code sequence; finally, the fourth coding sequence and the sixth coding sequence are spliced, and therefore codes corresponding to the parts of the Chinese characters can be obtained.

Further, for example, the chinese character is "middle", the component included in the chinese character is "middle" obtained in step 401, and the component structure relationship is a single-body structure; then, modifying the element value corresponding to the part of 'middle' in the third coding sequence into a first bit value (for example, 1) to obtain a fourth coding sequence, and modifying the element value corresponding to the 'individual body structure' in the fifth coding sequence into the first bit value (for example, 1) to obtain a fourth six coding sequence; finally, the fourth coding sequence and the sixth coding sequence are spliced, and therefore the corresponding code of the Chinese character 'middle' can be obtained.

In addition, the structural relationship between the components may have a plurality of different division rules, for example: "Xie Ji", can be defined as the independent structure, also can be defined as the upper and lower structure; "escape" may be defined as an upper-lower structure, a left-right structure, or the like.

Returning to fig. 2, in step 203, a target chinese character similar to the chinese character to be corrected is determined from the plurality of preset chinese characters according to the codes corresponding to the plurality of preset chinese characters stored in the chinese character information base and the code of the chinese character to be corrected.

In this disclosure, the preset Chinese characters do not include the Chinese character to be corrected obtained in step 201. Moreover, the preset chinese characters may be preset by the user or may be default (for example, the preset chinese characters include other chinese characters in the chinese character information base except the chinese character to be corrected, or the preset chinese characters include other chinese characters in the common chinese character except the chinese character to be corrected), and are not limited in this disclosure.

In one embodiment, the codes corresponding to the preset Chinese characters and the codes of the Chinese characters to be corrected are matched for each preset Chinese character in the preset Chinese characters; and if the matching rate is greater than the preset matching rate threshold value, determining that the preset Chinese character is similar to the Chinese character to be corrected, and determining the preset Chinese character as the target Chinese character. The preset matching rate threshold may be set by a user according to a coding length, or may be default, and is not specifically limited in this disclosure.

For example, if there are 350 parts and structural relationships between the parts included in all the chinese characters in the chinese character information library, the matching rate threshold may be set to 69/70.

In another embodiment, the target kanji may be determined through step 2031 and step 2032 shown in fig. 5.

In step 2031, for each preset chinese character, the similarity between the code corresponding to the preset chinese character and the code of the chinese character to be corrected is calculated.

In the present disclosure, the similarity between the code corresponding to each preset Chinese character and the code of the Chinese character to be corrected can be calculated by the euclidean distance, the cosine distance, the hamming distance, and the like.

In step 2032, if it is determined according to the similarity that the preset chinese character corresponding to the similarity is similar to the chinese character to be corrected, the preset chinese character corresponding to the similarity is determined as the target chinese character.

In an embodiment, when the similarity is greater than a first preset similarity threshold, it may be determined that the preset chinese character corresponding to the similarity is similar to the chinese character to be corrected.

For example, in step 2031, the euclidean distance or the cosine distance is used to calculate the similarity between the code corresponding to each preset chinese character and the code of the chinese character to be corrected, so that when the similarity is greater than the first preset similarity threshold, it may be determined that the preset chinese character corresponding to the similarity is similar to the chinese character to be corrected.

In another embodiment, when the similarity is smaller than a second preset similarity threshold, it may be determined that the preset chinese character corresponding to the similarity is similar to the chinese character to be corrected.

Illustratively, the step 2031 calculates the similarity between the code corresponding to each preset chinese character and the code of the chinese character to be corrected by using the hamming distance, so that when the similarity is smaller than the second preset similarity threshold, it can be determined that the preset chinese character corresponding to the similarity is similar to the chinese character to be corrected.

In addition, it should be noted that the first preset similarity threshold and the second preset similarity threshold may be set by a user, or may be default empirical values, and the two may be equal or unequal, which is not specifically limited in this disclosure.

Returning to fig. 2, in step 204, the target chinese character is sent to the client for presentation by the client.

In the present disclosure, after the target chinese character similar to the chinese character to be corrected is obtained in step 203, the target chinese character may be sent to the client; the client receives and displays the target Chinese character.

In the technical scheme, after a Chinese character error correction request sent by a client is received, firstly, the codes of Chinese characters to be corrected contained in the request to be corrected are determined; then, according to codes corresponding to a plurality of preset Chinese characters stored in a Chinese character information base and codes of Chinese characters to be corrected, target Chinese characters similar to the Chinese characters to be corrected are determined from the preset Chinese characters; and finally, feeding the target Chinese character back to the client side to be displayed at the client side. Because the codes adopted by the Chinese characters in the method can represent the components contained in the corresponding Chinese characters and the structural relationship among the components, the same components or structures exist among the Chinese characters with similar codes. Therefore, the target Chinese character which is determined according to the corresponding codes of the Chinese characters and is similar to the Chinese character to be corrected has correlation with the Chinese character to be corrected, so that the target Chinese character which has correlation with the Chinese character to be corrected is used for correcting the Chinese character to be corrected, and the correction accuracy and the correction efficiency can be improved.

Fig. 6 is a block diagram illustrating an apparatus for chinese character recognition error correction according to an exemplary embodiment. Referring to fig. 6, the apparatus 60 includes: the receiving module 61 is used for receiving a Chinese character error correction request sent by a client, wherein the Chinese character error correction request comprises Chinese characters to be corrected; a first determining module 62, configured to determine a code of the chinese character to be error-corrected, where the code is used to represent components and structural relationships between the components included in the chinese character to be error-corrected, and the components include components and radicals; a second determining module 63, configured to determine, according to codes corresponding to a plurality of preset chinese characters stored in a chinese character information base and the code of the chinese character to be corrected determined by the first determining module 62, a target chinese character similar to the chinese character to be corrected from the plurality of preset chinese characters, where the plurality of preset chinese characters do not include the chinese character to be corrected; a sending module 64, configured to send the target chinese character determined by the second determining module 63 to the client, so as to be displayed by the client.

Fig. 7 is a block diagram illustrating an encoding apparatus according to an example embodiment. Referring to fig. 7, the encoding apparatus 70 may include: an obtaining module 71, configured to obtain, for each chinese character in the chinese character information base, a component and a structural relationship between components included in the chinese character; a third determining module 72, configured to modify, for each component obtained by the obtaining module 71, an element value corresponding to the component in a first coding sequence into a first bit value to obtain a second coding sequence, where the first coding sequence is a binary bit sequence in which each element value is a second bit value, and each component or structural relationships among components in a component structure set correspond to each element in the first coding sequence one to one, and the component structure set is a set formed by components and structural relationships among components included in all chinese characters in the chinese character information base; a fourth determining module 73, configured to modify, for each inter-component structural relationship obtained by the obtaining module 71, an element value corresponding to the inter-component structural relationship in the second coding sequence to the first bit value, so as to obtain a code corresponding to the chinese character.

Fig. 8 is a block diagram illustrating an encoding apparatus according to another exemplary embodiment. Referring to fig. 8, the encoding apparatus 70 may include: an obtaining module 71, configured to obtain, for each chinese character in the chinese character information base, a component and a structural relationship between components included in the chinese character; a fifth determining module 74, configured to modify, for each component obtained by the obtaining module 71, an element value corresponding to the component in a third coding sequence into a first bit value to obtain a fourth coding sequence, where the third coding sequence is a binary bit sequence in which each element value is a second bit value, each component in a component set corresponds to each element in the third coding sequence one to one, and the component set is a set formed by components included in all chinese characters in the chinese character information base; a sixth determining module 75, configured to modify, for each inter-component structural relationship obtained by the obtaining module 71, an element value corresponding to the inter-component structural relationship in a fifth coding sequence into the first bit value, so as to obtain a sixth coding sequence, where the fifth coding sequence is a binary bit sequence in which each element value is the second bit value, structural relationships among components in a structure set correspond to elements in the fifth coding sequence one to one, and the structure set is a set formed by the structural relationships among components included in all the chinese characters in the chinese character information base; a splicing module 76, configured to splice the fourth coding sequence obtained by the fifth determining module 74 and the sixth coding sequence obtained by the sixth determining module 75 to obtain a code corresponding to the chinese character.

The encoding device 70 may be independent of the chinese character recognition and error correction device 60, or may be integrated into the chinese character recognition and error correction device 60, and is not particularly limited in this disclosure.

Fig. 9 is a block diagram illustrating a chinese character recognition error correction apparatus according to another exemplary embodiment. Referring to fig. 9, the second determination module 63 includes: the calculating sub-module 631 is configured to calculate, for each preset chinese character, a similarity between a code corresponding to the preset chinese character and a code of the chinese character to be corrected; the determining submodule 632 is configured to determine the preset Chinese character corresponding to the similarity as the target Chinese character if it is determined that the preset Chinese character corresponding to the similarity is similar to the Chinese character to be corrected according to the similarity obtained by the calculating submodule 631.

The present disclosure also provides a computer readable medium, on which a computer program is stored, which when executed by a processing device implements the steps of the above-mentioned chinese character recognition error correction method provided by the present disclosure.

Referring now to FIG. 10, a block diagram of an electronic device (e.g., server 100 of FIG. 1) 600 suitable for use in implementing embodiments of the present disclosure is shown. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 10 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.

As shown in fig. 10, electronic device 600 may include a processing means (e.g., central processing unit, graphics processor, etc.) 601 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.

Generally, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 10 illustrates an electronic device 600 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.

In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 609, or may be installed from the storage means 608, or may be installed from the ROM 602. The computer program, when executed by the processing device 601, performs the above-described functions defined in the methods of the embodiments of the present disclosure.

It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.

In some embodiments, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText transfer protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.

The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.

The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: receiving a Chinese character error correction request sent by a client, wherein the Chinese character error correction request comprises Chinese characters to be corrected; determining the codes of the Chinese characters to be corrected, wherein the codes are used for representing components and structural relations among the components contained in the Chinese characters to be corrected, and the components comprise components and radicals; determining a target Chinese character similar to the Chinese character to be corrected from a plurality of preset Chinese characters according to codes corresponding to the preset Chinese characters stored in a Chinese character information base and the codes of the Chinese characters to be corrected, wherein the preset Chinese characters do not comprise the Chinese characters to be corrected; and sending the target Chinese characters to the client side to be displayed by the client side.

Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).

The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.

The modules described in the embodiments of the present disclosure may be implemented by software or hardware. The name of the module does not in some cases form a limitation on the module itself, and for example, the first determination module may also be described as a "module for determining the code of the chinese character to be corrected".

The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.

In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

Example 1 provides a chinese character recognition error correction method according to one or more embodiments of the present disclosure, including: receiving a Chinese character error correction request sent by a client, wherein the Chinese character error correction request comprises Chinese characters to be corrected; determining the codes of the Chinese characters to be corrected, wherein the codes are used for representing components and structural relations among the components contained in the Chinese characters to be corrected, and the components comprise components and radicals; determining a target Chinese character similar to the Chinese character to be corrected from a plurality of preset Chinese characters according to codes corresponding to the preset Chinese characters stored in a Chinese character information base and the codes of the Chinese characters to be corrected, wherein the preset Chinese characters do not comprise the Chinese characters to be corrected; and sending the target Chinese characters to the client side to be displayed by the client side.

Example 2 provides the method of example 1, the code corresponding to each chinese character in the chinese character information base is determined by: aiming at each Chinese character in the Chinese character information base, acquiring components contained in the Chinese character and structural relations among the components; modifying element values corresponding to the parts in a first coding sequence into first bit values aiming at each part to obtain a second coding sequence, wherein the first coding sequence is a binary bit sequence with each element value being a second bit value, each part or structural relations among the parts in a part structure set respectively correspond to each element in the first coding sequence one by one, and the part structure set is a set formed by the parts and the structural relations among the parts contained in all Chinese characters in the Chinese character information base; and modifying the element values corresponding to the structural relationship among the parts in the second coding sequence into the first bit values aiming at the structural relationship among the parts to obtain the codes corresponding to the Chinese characters.

Example 3 provides the method of example 1, the code corresponding to each chinese character in the chinese character information base is determined by: aiming at each Chinese character in the Chinese character information base, acquiring components contained in the Chinese character and structural relations among the components; modifying element values corresponding to the parts in a third coding sequence into first bit values aiming at each part to obtain a fourth coding sequence, wherein the third coding sequence is a binary bit sequence with each element value being a second bit value, each part in a part set is respectively in one-to-one correspondence with each element in the third coding sequence, and the part set is a set formed by parts contained in all Chinese characters in the Chinese character information base; modifying element values in a fifth coding sequence corresponding to the structural relationship among the parts into the first bit values according to the structural relationship among the parts to obtain a sixth coding sequence, wherein the fifth coding sequence is a binary bit sequence with all the element values being the second bit values, the structural relationship among the parts in a structural set respectively corresponds to all the elements in the fifth coding sequence one by one, and the structural set is a set formed by the structural relationship among the parts contained in all the Chinese characters in the Chinese character information base; and splicing the fourth coding sequence and the sixth coding sequence to obtain the codes corresponding to the Chinese characters.

Example 4 provides the method of any one of examples 1 to 3, wherein determining a target chinese character similar to the chinese character to be corrected from the plurality of preset chinese characters according to codes corresponding to the plurality of preset chinese characters stored in the chinese character information base and the code of the chinese character to be corrected includes: calculating the similarity between the codes corresponding to the preset Chinese characters and the codes of the Chinese characters to be corrected according to each preset Chinese character; and if the preset Chinese character corresponding to the similarity is determined to be similar to the Chinese character to be corrected according to the similarity, determining the preset Chinese character corresponding to the similarity as a target Chinese character.

Example 5 provides a chinese character recognition error correction apparatus according to one or more embodiments of the present disclosure, including: the system comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving a Chinese character error correction request sent by a client, and the Chinese character error correction request comprises Chinese characters to be corrected; the first determining module is used for determining the codes of the Chinese characters to be corrected, wherein the codes are used for representing the structural relationship between components and parts contained in the Chinese characters to be corrected, and the components comprise components and radicals; the second determining module is used for determining a target Chinese character similar to the Chinese character to be corrected from the plurality of preset Chinese characters according to codes corresponding to the plurality of preset Chinese characters stored in a Chinese character information base and the code of the Chinese character to be corrected determined by the first determining module, wherein the plurality of preset Chinese characters do not comprise the Chinese character to be corrected; and the sending module is used for sending the target Chinese characters determined by the second determining module to the client side so as to be displayed by the client side.

Example 6 provides the apparatus of example 5, the encoding device determining a corresponding code for each chinese character in the chinese character information base, wherein the encoding device includes: the acquisition module is used for acquiring components contained in the Chinese characters and structural relations among the components aiming at each Chinese character in the Chinese character information base; a third determining module, configured to modify, for each component obtained by the obtaining module, an element value corresponding to the component in a first coding sequence into a first bit value to obtain a second coding sequence, where the first coding sequence is a binary bit sequence in which each element value is a second bit value, and each component or structural relationships among components in a component structure set correspond to each element in the first coding sequence one to one, and the component structure set is a set formed by components and structural relationships among components included in all chinese characters in the chinese character information base; and a fourth determining module, configured to modify, for each inter-component structural relationship obtained by the obtaining module, an element value corresponding to the inter-component structural relationship in the second coding sequence to the first bit value, so as to obtain a code corresponding to the Chinese character.

Example 7 provides the apparatus of example 5, the encoding device determining a corresponding code for each chinese character in the chinese character information base, wherein the encoding device includes: the acquisition module is used for acquiring components contained in the Chinese characters and structural relations among the components aiming at each Chinese character in the Chinese character information base; a fifth determining module, configured to modify, for each component obtained by the obtaining module, an element value corresponding to the component in a third coding sequence into a first bit value to obtain a fourth coding sequence, where the third coding sequence is a binary bit sequence in which each element value is a second bit value, each component in a component set corresponds to each element in the third coding sequence one to one, and the component set is a set formed by components included in all chinese characters in the chinese character information base; a sixth determining module, configured to modify, for each inter-component structural relationship obtained by the obtaining module, an element value corresponding to the inter-component structural relationship in a fifth coding sequence into the first bit value, so as to obtain a sixth coding sequence, where the fifth coding sequence is a binary bit sequence in which each element value is the second bit value, structural relationships among components in a structure set are respectively in one-to-one correspondence with each element in the fifth coding sequence, and the structure set is a set formed by structural relationships among components included in all chinese characters in the chinese character information base; and the splicing module is used for splicing the fourth coding sequence obtained by the fifth determining module and the sixth coding sequence obtained by the sixth determining module to obtain the codes corresponding to the Chinese characters.

Example 8 provides the apparatus of any one of examples 5-7, the second determining module comprising: the calculation submodule is used for calculating the similarity between the codes corresponding to the preset Chinese characters and the codes of the Chinese characters to be corrected aiming at each preset Chinese character; and the determining submodule is used for determining the preset Chinese character corresponding to the similarity as the target Chinese character if the preset Chinese character corresponding to the similarity is determined to be similar to the Chinese character to be corrected according to the similarity obtained by the calculating submodule.

Example 9 provides a computer readable medium having stored thereon a computer program that, when executed by a processing apparatus, performs the steps of the method of any of examples 1-4, in accordance with one or more embodiments of the present disclosure.

Example 10 provides, in accordance with one or more embodiments of the present disclosure, an electronic device comprising: a storage device having a computer program stored thereon; processing means for executing the computer program in the storage means to carry out the steps of the method of any of examples 1-4.

The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.

Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.

Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims. With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.

23页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种基于摄像头的平面图案识别方法及其装置与应用

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!