Polyphonetic character processing method, device, electronic device and storage medium

By identifying and processing the phonetic notation of multi-phonetic characters in the scanning pen, the problem of the inability of the existing technology to recognize multi-phonetic characters is solved, and the accuracy of text recognition and translation is improved.

CN113052179BActive Publication Date: 2024-10-15HEFEI IFLYTEK TOYCLOUD TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110254598.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-09
Publication Date
2024-10-15
Estimated Expiration
2041-03-09

AI Technical Summary

Technical Problem

The existing scanning pen technology cannot recognize the phonetic notation of multi-phonetic characters, resulting in the inability to accurately achieve speech synthesis and semantic understanding, and unable to perform accurate translation.

Method used

By acquiring the scanned image, cutting and identifying the phonetic notes and characters in the text, and determining the polyphonetic characters corresponding to each phonetic note, the recognition and processing of the polyphonic characters can be realized.

Benefits of technology

It improves the accuracy of text recognition, enables correct understanding of semantics and accurate translation, and solves the problem of being unable to recognize the phonetic notation of multi-phonetic characters.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113052179B_ABST
    Figure CN113052179B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device, electronic device and storage medium for processing polyphones, the method comprising: acquiring a scanned image, performing line cutting on the scanned image to obtain a target image, performing recognition on the target image to obtain the at least one phonetic notation and the multiple characters, and determining the polyphonetic character corresponding to each phonetic notation from the multiple characters based on the at least one phonetic notation. The present application determines polyphonetic characters in a text by scanning and recognizing phonetic notations in the text, which can solve the problem of being unable to recognize phonetic notations of polyphonetic characters in the text and improve the recognition effect of the text.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, device, electronic device and storage medium for processing polyphones. Background Art

[0002] With the development of electronic technology, the types of electronic devices are becoming more and more abundant. The scanning pen, also known as a micro scanner or a hand-scratching scanning pen, is a handheld electronic device. When the tip of the scanning pen is swept over the text on books and newspapers, the built-in optical character recognition (OCR) module can be used to recognize, store, edit, and perform other operations on the text on books and newspapers. For the recognized text, the scanning pen can read and translate the text through the built-in pronunciation (Text To Speech, TTS) module and translation module. Polyphones refer to a word with two or more pronunciations. Different pronunciations have different meanings, different usages, and often different parts of speech. Pronunciation has the function of distinguishing parts of speech and meanings; depending on the usage, the pronunciation is also different, and the pronunciation has the function of distinguishing usages.

[0003] There are a lot of polyphonetic characters marked with phonetic symbols in students' textbooks and learning materials. However, the existing scanning pen technology only supports the scanning and recognition of text, and cannot recognize the phonetic symbols of polyphonetic characters in the scanned text. Therefore, in this case, the scanning pen cannot accurately realize speech synthesis, cannot correctly understand the semantics, and cannot accurately translate based on this. Summary of the invention

[0004] The embodiments of the present application propose a polyphonetic character processing method device, electronic device and storage medium, which can support the scanning and recognition of phonetic symbols, thereby improving the recognition effect of text.

[0005] In a first aspect, an embodiment of the present application provides a method for processing a polyphonetic character, the method comprising:

[0006] Acquire a scanned image;

[0007] Performing row cutting on the scanned image to obtain a target image;

[0008] Recognize the target image to obtain the at least one phonetic symbol and the multiple characters;

[0009] Based on the at least one phonetic notation, a polyphonetic character corresponding to each phonetic notation is determined from the plurality of characters.

[0010] In a second aspect, an embodiment of the present application provides a polyphonetic character processing device, the device comprising:

[0011] An acquisition unit, used for acquiring a scanned image;

[0012] A line cutting unit, used for cutting the scanned image to obtain a target image, wherein the target image includes at least one phonetic symbol and a plurality of characters;

[0013] A recognition unit, used for recognizing the target image to obtain the at least one phonetic symbol and the plurality of characters;

[0014] A determining unit, based on the at least one phonetic notation, determines from the plurality of characters the polyphonic character corresponding to each phonetic notation

[0015] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and the program includes instructions for executing the steps of any method of the first aspect of the embodiment of the present application.

[0016] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for electronic data exchange, wherein the computer program enables a computer to execute part or all of the steps described in any method of the first aspect of the embodiment of the present application.

[0017] In a fifth aspect, an embodiment of the present application provides a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute some or all of the steps described in any method of the first aspect of the embodiment of the present application. The computer program product may be a software installation package.

[0018] The polyphonetic character processing method provided in the embodiment of the present application obtains a scanned image, performs line cutting on the scanned image to obtain a target image, performs recognition on the target image to obtain the at least one phonetic notation and the multiple characters, and based on the at least one phonetic notation, determines the polyphonetic character corresponding to each phonetic notation from the multiple characters. The present application determines the polyphonetic characters in the text by scanning and recognizing the phonetic notation in the text, which can solve the problem of being unable to recognize the phonetic notation of polyphonetic characters in the text and improve the recognition effect of the text. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0020] Figure 1 It is a structural architecture diagram of a text recognition system provided by an embodiment of the present application;

[0021] Figure 2 It is a flow chart of a method for processing polyphonetic characters provided in an embodiment of the present application;

[0022] Figure 3a is a schematic diagram of a scanned image provided in an embodiment of the present application;

[0023] Figure 3b is a schematic diagram of another scanned image provided in an embodiment of the present application;

[0024] Figure 4a is a schematic diagram of an intermediate image provided in an embodiment of the present application;

[0025] Figure 4b is a schematic diagram of a target image provided in an embodiment of the present application;

[0026] Figure 4c is a schematic diagram of another target image provided in an embodiment of the present application;

[0027] Figure 5 This is a block diagram of the functional units of a polyphonetic character processing device provided in an embodiment of the present application;

[0028] Figure 6 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0029] The embodiments of the present application are described in detail below in conjunction with the accompanying drawings.

[0030] It should be understood that the "at least one" involved in the embodiments of the present application refers to one or more, and "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.

[0031] Furthermore, unless otherwise specified, ordinal numbers such as "first" and "second" mentioned in the embodiments of the present application are used to distinguish multiple objects, and are not used to limit the order, timing, priority or importance of multiple objects. For example, the first information and the second information are only used to distinguish different information, and do not indicate the difference in content, priority, sending order or importance of the two types of information.

[0032] It should be understood that the polyphone processing method provided in the present application can be applied to a system including a text recognition function in an electronic device, such as an electronic scanning pen, a point reading pen, a translation pen, etc. Specifically, the text recognition system can be operated with Figure 1 In the structural diagram shown in Figure 1 As shown, Figure 1 As shown, the system includes an optical character recognition (ORC) module, an annotation module, a text to speech (TTS) module and a translation module. Among them, ORC is used to recognize the text and phonetic notation in the scanned image collected by the electronic device; the annotation module is used to annotate the recognized phonetic notation into the recognized pinyin of the polyphonetic character; the TTS module is used to convert the recognized text including the polyphonetic notation into voice data and play it; the translation module is used to understand the semantics of the recognized text including the polyphonetic notation and translate it.

[0033] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0034] See also Figure 2 , Figure 2 A flow chart of a polyphonetic character processing method provided in an embodiment of the present application. Figure 2 As shown, the polyphonetic character processing method includes the following steps.

[0035] S210: Acquire a scanned image.

[0036] Among them, the scanned image can be an image (such as a student textbook, learning materials) of text content including phonetic annotations for polyphonetic characters captured by a scanning device (such as a scanner, a scanning pen, a camera and other electronic devices); it can also be a stored picture or a document in picture format of text content including phonetic annotations for polyphonetic characters, and the embodiments of the present application are not limited to this.

[0037] Exemplarily, the scanned image can also be obtained from a local device, other electronic devices, or a server; perform text recognition on the scanned image to recognize the text and phonetic notations in the scanned image. Further, the electronic device obtains polyphonic character information from the database possessed by the server through data communication with the server, for example, obtains all the pronunciations of a character from the pinyin database possessed by the server.

[0038] S220. Perform line cutting on the scanned image to obtain a target image.

[0039] In a specific implementation, before performing line cutting on the scanned image, the scanned image can be preprocessed first to reduce the useless information in the scanned image, so as to facilitate subsequent processing. When preprocessing the scanned image, operations such as binarization, noise reduction, and normalization can be performed. After binarization, the grayscale image of the scanned image can be converted into a binary image, and the grayscale values of the pixel points on the image are set to 0 or 255; noise reduction can perform denoising processing on the scanned image according to the characteristics of the noise. If the text line is inclined, inclination correction is often required. Normalization is to regularize individual text images to the same size, so that all text images apply a unified algorithm under the same specification.

[0040] Optionally, when at least one of the phonetic notations and the multiple characters are respectively located in adjacent rows; the performing line cutting on the scanned image to obtain a target image includes: performing line cutting on the scanned image to obtain at least one intermediate image, each intermediate image including a text line and a phonetic notation line; performing line cutting on each intermediate image to obtain at least one target image, the target image including a text image and a phonetic notation image.

[0041] Polyphonic characters are a unique phenomenon in Chinese. For the same character, if different pronunciations are selected for the polyphonic character, it will present completely different meanings. For example, in the sentence "The chanyu can only ride a horse, not a bicycle", the character "单" is a polyphonic character. The first "单" is pronounced as "chǎn" and refers to the leader of the Xiongnu tribe; the second "单" is pronounced as "dān" and refers to a riding tool. These two pronunciations will result in completely different meanings of the sentence. In students' textbooks and learning materials, there are mainly two forms for the phonetic notations of polyphonic characters. One is that the polyphonic character and the phonetic notation are arranged in separate lines, as Figure 3a shown, the phonetic notation and the text are respectively located in two lines, and the phonetic notation is in the upper line corresponding to the position of the polyphonic character; the other is that the polyphonic character and the phonetic notation are arranged in the same line and mixed, as Figure 3b shown, the phonetic notation and the text are arranged in the same line, and the phonetic notation is enclosed in parentheses and located behind the polyphonic character.

[0042] Among them, the scanning width of the scanning device is larger than the height of the text, so the scanned image obtained by the scanning device, in addition to the image of the target line, inevitably contains other image data, such as part of the image of the previous line, part of the image of the next line, blank images, etc. Therefore, in order to perform text recognition, the scanned image needs to be cut into lines first to cut off invalid images (such as incomplete line images, blank images, etc.) to obtain lines of images containing only text lines and phonetic lines.

[0043] Specifically, when the phonetic notation and the text are located in adjacent lines, specifically, the phonetic notation is located in the upper line of the polyphonic character, or the phonetic notation is located in the lower line of the polyphonic character, the scanned image is divided into multiple intermediate images, each of which includes a line of text and a corresponding line of phonetic notation, for example, Figure 3a The scanned image shown can be divided into Figure 4a Middle image shown.

[0044] Furthermore, after the intermediate image is obtained by segmentation, it is necessary to further segment the intermediate image, specifically, to segment each intermediate image into a line of text and a line of phonetic notation, such as Figure 4b shown.

[0045] It can be understood that when the text in the scanned image is arranged in rows, the operations in the embodiments of the present application are all processed and described in rows; when the text in the scanned image is arranged in columns, the operations in the embodiments of the present application are all processed and described in columns.

[0046] In a possible example, when the phonetic notation is in the same line as the text, specifically, the phonetic notation is located behind the polyphonic character, or the phonetic notation is located in front of the polyphonic character, the scanned image is segmented into at least one target image, each intermediate image includes a whole line of text and / or phonetic notation, for example, Figure 3b The scanned image shown can be divided into Figure 4c The target image is shown.

[0047] For example, since the row and column spacing and character spacing of the printed text image are roughly equal and there is almost no adhesion phenomenon, the projection method can be used to segment the scanned image and / or intermediate image, and the projection curve of the pixel value of each row on the horizontal axis is a non-smooth curve. The area between each trough position of the curve after Gaussian smoothing is the desired row.

[0048] It should be noted that after a large amount of data training, the line-slicing algorithm can be used to split the phonetic symbols and text arranged in separate lines. If the algorithm can split the image again after the first line-slicing, it means that this line is a polyphonetic character and phonetic symbols arranged in separate lines. Figure 4bAs shown. If the image after the first line cutting cannot be cut again, it means that this line is in the form of a polyphonic character mixed with phonetic notations. The image after line cutting is as Figure 4c shown.

[0049] S230. Identify the target image to obtain the at least one phonetic notation and the multiple characters.

[0050] Among them, after the scanned image is segmented, the target image can be subjected to character recognition and phonetic notation recognition to respectively obtain the characters and phonetic notations in the target image.

[0051] Optionally, the identifying the target image to obtain the at least one phonetic notation and the multiple characters includes: using a pinyin recognition model to recognize the phonetic notation image to obtain multiple pinyin letters in the phonetic notation image; dividing at least one consecutive adjacent pinyin letter with the distance between the pinyin letters less than or equal to a threshold into one phonetic notation to obtain the at least one phonetic notation, and recording the start and end coordinates of each phonetic notation; using a character recognition model to recognize the character image to obtain the multiple characters, and recording the start and end coordinates of each character.

[0052] Specifically, when the phonetic notation and the polyphonic character are in adjacent lines, the target images cut out by the second line cutting can be identified in sequence. If the first line is the phonetic notation line, each pinyin letter is sequentially recognized through the pinyin recognition model, and these pinyin letters are cut into phonetic notations with spaces, and the horizontal start and end coordinates of each phonetic notation relative to the left edge of the phonetic notation image are recorded. The second line is the character line. Each character is sequentially recognized through the character recognition model, and the horizontal start and end coordinates of each character relative to the left edge of the character image are recorded. For example, for the phonetic notations in Figure 4b , by using the pinyin recognition model to recognize the phonetic notations in the first line, the 5 pinyin letters 'z', 'h', 'ǎ', 'n', 'g' can be recognized. Then, according to the horizontal start and end coordinates of each pinyin letter relative to the left edge of the phonetic notation image, the distances between the pinyin letters are calculated. If the distance between adjacent pinyin letters is less than or equal to the threshold, the adjacent pinyin letters are divided into one phonetic notation until the last pinyin letter, so as to combine them into the phonetic notation 'zhǎng', and the horizontal start and end coordinates of this phonetic notation in the image are recorded, that is, the start and end coordinates of the first pinyin letter 'z' and the last pinyin letter 'g' in this phonetic notation. By using the character recognition model to recognize the second line, the 7 characters '南', '京', '市', '长', '江', '大', '桥' can be recognized, and the horizontal start and end coordinates of each character in the character image are respectively recorded.

[0053] Optionally, when the at least one phonetic annotation and the plurality of characters are on the same line; the recognizing the target image to obtain the at least one phonetic annotation and the plurality of characters includes: using an optical character recognition (OCR) model to recognize the target image from left to right. When a first symbol is recognized under the OCR model, use a pinyin recognition model for recognition. When a second symbol is recognized under the pinyin recognition model, use the OCR model for recognition to obtain the plurality of characters and a plurality of pinyin letters; divide at least one pinyin letter among the plurality of pinyin letters whose distance is less than or equal to a preset threshold and are continuously adjacent into one phonetic annotation to obtain the at least one phonetic annotation, and record the start and end coordinates of each phonetic annotation and each character.

[0054] Among them, in students' textbooks and learning materials, when a phonetic annotation and a polyphonic character are on the same line, generally use parentheses to mark the phonetic annotation as the pronunciation of the polyphonic character. Therefore, the first symbol may be “(”, and the second symbol may be “)”. Exemplarily, when using square brackets to mark the phonetic annotation as the pronunciation of the polyphonic character, the first symbol may be “[”, and the second symbol may be “]”; when using curly brackets to mark the phonetic annotation as the pronunciation of the polyphonic character, the first symbol may be “{”, and the second symbol may be “}”. Of course, the embodiments of the present application do not limit the use of other symbols to mark the phonetic annotation as the pronunciation of the polyphonic character.

[0055] Specifically, when a phonetic annotation and a polyphonic character are on the same line, the target image obtained by directly cutting the line for the first time can be recognized from left to right. If the first symbol is not recognized, use the OCR model to recognize the target image to obtain the characters in the target image. If the first symbol is recognized, use the pinyin recognition model to recognize the pinyin after the first symbol to obtain the pinyin letters in the target image until the second character is recognized, and then switch to the OCR model to recognize the characters after the second symbol, and follow this method until the last character or pinyin. Then, according to the horizontal start and end coordinates of each pinyin letter relative to the left edge of the phonetic annotation image, calculate the distance between the pinyin letters. If the distance between adjacent pinyin letters is less than or equal to the threshold, divide the adjacent pinyin letters into one phonetic annotation until the last pinyin letter, so as to combine the letters into a phonetic annotation. For example, for the Figure 4c target image described above, “南 (nán)”, “京 (jīng)”, “市 (shì)”, “长 (zhǎng)”, “江 (jiāng)”, “大 (dà)”, “桥 (qiáo)” can be recognized in sequence. And record the horizontal start and end coordinates of each character and pinyin in the target image respectively.

[0056] S240. Based on the at least one phonetic annotation, determine the polyphonic character corresponding to each phonetic annotation from the plurality of characters.

[0057] Among them, since the lengths (starting and ending coordinates) of polyphonetic characters and corresponding phonetic symbols are different, or the positions of phonetic symbols relative to polyphonetic characters are different, it is necessary to further determine the polyphonetic character corresponding to each phonetic symbol based on the starting and ending coordinates of the phonetic symbols.

[0058] Optionally, determining the polyphonetic character corresponding to each phonetic symbol from the multiple characters based on the at least one phonetic symbol includes: determining at least one candidate character corresponding to each phonetic symbol from the multiple characters based on the start and end coordinates of each phonetic symbol and the start and end coordinates of each character; and determining the polyphonetic character corresponding to each phonetic symbol from the at least one candidate character corresponding to each phonetic symbol.

[0059] In a possible example, the start and end coordinates of the phonetic symbol completely or partially overlap with the start and end coordinates of the candidate characters.

[0060] Wherein, when the phonetic notation and the polyphonetic character are located in adjacent rows, the phonetic notation may be located at the position of the previous row or the next row corresponding to the position of the polyphonetic character. Since the length of the phonetic notation may be different from the length of the polyphonetic character, the start and end coordinates of a phonetic notation may overlap or partially overlap with the start and end coordinates of multiple characters on the ordinate. A certain character among the multiple characters that completely or partially overlap with the start and end coordinates of the phonetic notation is the polyphonetic character corresponding to the phonetic notation. Therefore, the multiple characters that completely or partially overlap with the start and end coordinates of the phonetic notation can be used as candidate characters for the phonetic notation, and then the polyphonetic character corresponding to the phonetic notation is determined from the multiple candidate characters. Exemplarily, if only the start and end coordinates of a character partially or completely overlap with the start and end coordinates of the phonetic notation, the character is directly determined as the polyphonetic character corresponding to the phonetic notation.

[0061] In another possible example, the start and end coordinates of the phonetic notation are adjacent to or spaced N apart from the start and end coordinates of the candidate character, where N is the number of phonetic notations whose start and end coordinates are consecutively adjacent.

[0062] When the phonetic notation and the polyphonic character are located in the same line, the phonetic notation can be located before or after the corresponding polyphonic character. Therefore, according to the starting and ending coordinates of the phonetic notation, the characters located before and after the phonetic notation can be used as candidate characters for the phonetic notation, and then the polyphonic character corresponding to the phonetic notation is determined from the two candidate characters. For example, if the phonetic notation only has the characters before or after, the characters before or after are directly determined as the polyphonic character corresponding to the phonetic notation.

[0063] Optionally, determining the polyphonetic character corresponding to each phonetic symbol from at least one candidate character corresponding to each phonetic symbol includes: obtaining all pinyins of each candidate character, matching all pinyins of each candidate character with corresponding phonetic symbols respectively; and determining the candidate character matched with each phonetic symbol as the polyphonetic character.

[0064] Specifically, traverse these candidate characters, search for the pinyins of all pronunciations of each candidate character from the database storing the pinyins of characters, and compare these pinyins with the phonetic notations one by one. If there is a pinyin that is the same as the phonetic notation, then determine the character corresponding to this pinyin as the polyphonic character corresponding to this phonetic notation.

[0065] For example, for the target image as shown Figure 4b Compare the start and end coordinates of the recognized phonetic notation "zhǎng" with the start and end coordinates of the recognized characters "南", "京", "市", "长", "江", "大", "桥" respectively. It can be obtained that the start and end coordinates of the three Chinese characters "市", "长", "江" and the start and end coordinates of the phonetic notation overlap. Therefore, search for all pronunciations of these three Chinese characters in the database and find that "长" has the pronunciation "zhǎng", so "长" is determined as the polyphonic character corresponding to this phonetic notation.

[0066] Optionally, the method further includes: labeling each phonetic notation with the pinyin of the corresponding polyphonic character; inputting the multiple characters and the pinyin of the polyphonic character into a translation module and / or a pronunciation module.

[0067] Among them, after determining the polyphonic character corresponding to each phonetic notation, the phonetic notation can be labeled with the pinyin of this polyphonic character, that is, record the phonetic notation into the data structure of this polyphonic character. Then send the sentences labeled with the pronunciation of the polyphonic character into the TTS module and the translation module respectively. Through the neural network algorithm of the TTS module, the audio data of the sentence can be synthesized and read out according to its pronunciation; and through the neural network algorithm of the translation module, the correct semantics of the sentence can be recognized according to its pronunciation, and then it can be translated into the target language.

[0068] It can be seen that the polyphonic character processing method proposed in the embodiment of the present application obtains a scanned image, performs line cutting on the scanned image to obtain a target image, performs recognition on the target image to obtain the at least one phonetic notation and the multiple characters, and determines the polyphonic character corresponding to each phonetic notation from the multiple characters based on the at least one phonetic notation. The present application determines the polyphonic characters in the text by scanning and recognizing the phonetic notations in the text, which can solve the problem of not being able to recognize the phonetic notations of polyphonic characters in the text and improve the recognition effect of the text.

[0069] The above mainly introduces the scheme of the embodiment of the present application from the perspective of the execution process on the method side. It is understandable that in order to realize the above functions, the terminal device includes a hardware structure and / or software module corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiment provided in this article, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0070] The embodiment of the present application can divide the terminal device into functional units according to the above method example. For example, each functional unit can be divided according to each function, or two or more functions can be integrated into one processing unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units. It should be noted that the division of units in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0071] See also Figure 5 , Figure 5 is a functional unit block diagram of a polyphonetic character processing device provided in an embodiment of the present application, wherein the device 500 comprises: an acquisition unit 510, a line cutting unit 520, a recognition unit 530 and a determination unit 540, wherein:

[0072] An acquisition unit 510, configured to acquire a scanned image;

[0073] A line cutting unit 520, configured to perform line cutting on the scanned image to obtain a target image, wherein the target image includes at least one phonetic symbol and a plurality of characters;

[0074] A recognition unit 530, configured to recognize the target image to obtain the at least one phonetic symbol and the plurality of characters;

[0075] The determining unit 540 is configured to determine the polyphonetic character corresponding to each of the phonetic symbols from the multiple characters based on the at least one phonetic symbol.

[0076] Optionally, when the at least one phonetic symbol and the plurality of characters are located in adjacent lines respectively, the line cutting unit 520 specifically includes:

[0077] The scanned image is cut into rows to obtain at least one intermediate image, each of which includes a text row and a phonetic row; each of the intermediate images is cut into rows to obtain at least one target image, which includes a text image and a phonetic image.

[0078] Optionally, the determination unit 540 is specifically used to: determine at least one candidate character corresponding to each phonetic symbol from the multiple characters based on the start and end coordinates of each phonetic symbol and the start and end coordinates of each character; and determine the polyphonetic character corresponding to each phonetic symbol from the at least one candidate character corresponding to each phonetic symbol.

[0079] Optionally, the recognition unit 530 is specifically used to: use a pinyin recognition model to recognize the phonetic image to obtain multiple pinyin letters in the phonetic image; divide at least one consecutive adjacent pinyin letter whose distance between the pinyin letters is less than or equal to a threshold into one phonetic, obtain the at least one phonetic, and record the start and end coordinates of each phonetic; use a text recognition model to recognize the text image to obtain the multiple characters, and record the start and end coordinates of each of the characters.

[0080] Optionally, the start and end coordinates of the phonetic symbol completely or partially overlap with the start and end coordinates of the candidate characters.

[0081] Optionally, when the at least one phonetic symbol and the multiple characters are located in the same row; the recognition unit 530 is specifically used to: use the text recognition model to recognize the target image from left to right, when the first symbol is recognized under the text recognition model, use the pinyin recognition model to recognize it, when the second symbol is recognized under the pinyin recognition model, use the text recognition model to recognize it, and obtain the multiple characters and multiple pinyin letters; divide the pinyin letters among the multiple pinyin letters whose distance is less than or equal to a preset threshold and at least one consecutive adjacent pinyin letter into one phonetic symbol, obtain the at least one phonetic symbol, and record the start and end coordinates of each phonetic symbol and each character.

[0082] Optionally, the start and end coordinates of the phonetic notation are adjacent to or spaced N apart from the start and end coordinates of the candidate characters, where N is the number of phonetic notations with consecutive adjacent start and end coordinates.

[0083] Optionally, in determining the polyphonetic character corresponding to each phonetic symbol from at least one candidate character corresponding to each phonetic symbol, the determination unit 540 specifically includes: obtaining all pinyins of each candidate character, matching all pinyins of each candidate character with the corresponding phonetic symbol respectively; and determining the candidate character matched with each phonetic symbol as the polyphonetic character.

[0084] Optionally, the device 500 further includes a marking unit 550, and the marking unit 550 is used to mark each of the phonetic symbols as the corresponding pinyin of the polyphonetic character;

[0085] The recognition unit 530 is further configured to input the plurality of characters and the pinyin of the polyphonetic character into a translation module and / or a pronunciation module.

[0086] It can be understood that the functions of each program module of the polyphonetic character processing device of the embodiment of the present application can be specifically implemented according to the method in the above method embodiment. The specific implementation process can refer to the relevant description of the above method embodiment, which will not be repeated here.

[0087] See also Figure 6 , Figure 6 A terminal device provided in an embodiment of the present application includes: a processor, a memory, a transceiver, and one or more programs. The processor, the memory, and the transceiver are interconnected via a communication bus.

[0088] The processor may be one or more central processing units (CPUs). When the processor is a CPU, the CPU may be a single-core CPU or a multi-core CPU.

[0089] The one or more programs are stored in the memory and configured to be executed by the processor; the programs include instructions for performing the following steps:

[0090] Acquire a scanned image;

[0091] Performing row cutting on the scanned image to obtain a target image;

[0092] Recognize the target image to obtain the at least one phonetic symbol and the multiple characters;

[0093] Based on the at least one phonetic notation, a polyphonetic character corresponding to each phonetic notation is determined from the plurality of characters.

[0094] It should be noted that the specific implementation process of the embodiments of the present application can refer to the specific implementation process described in the above method embodiments, which will not be repeated here.

[0095] An embodiment of the present application also provides a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, and the computer program enables a computer to execute part or all of the steps of any method recorded in the above method embodiments.

[0096] The present application also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute some or all of the steps of any method described in the above method embodiment. The computer program product may be a software installation package.

[0097] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0098] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0099] In the several embodiments provided in the present application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of the above-mentioned units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.

[0100] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of the present application.

[0101] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0102] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned memory includes: various media that can store program codes, such as USB flash drives, ROM, RAM, mobile hard disks, magnetic disks or optical disks.

[0103] A person skilled in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing the relevant hardware through a program, and the program may be stored in a computer-readable memory, which may include a flash drive, ROM, RAM, a magnetic disk or an optical disk, etc.

[0104] The embodiments of the present application are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of ​​the present application. At the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A method for processing polyphones, characterized in that: Applied to a scanning electronic device including a text recognition function, the method comprises: Acquiring an image of text content including phonetic notation of polyphonetic characters to obtain a scanned image; Acquire the scanned image; Performing row cutting on the scanned image to obtain a target image; Recognize the target image to obtain at least one phonetic symbol and multiple characters; Based on the at least one phonetic notation, determining the polyphonetic character corresponding to each phonetic notation from the multiple characters, comprising: determining at least one candidate character corresponding to each phonetic notation from the multiple characters based on the start and end coordinates of each phonetic notation and the start and end coordinates of each character; determining the polyphonetic character corresponding to each phonetic notation from the at least one candidate character corresponding to each phonetic notation; Marking each of the phonetic symbols as the corresponding pinyin of the polyphonetic character; Input the plurality of characters and the pinyin of the polyphonic characters into a translation module and / or a pronunciation module; When the at least one phonetic symbol and the multiple characters are located in the same row; the target image is recognized to obtain at least one phonetic symbol and multiple characters, including: using a character recognition model to recognize the target image from left to right, when a first symbol is recognized under the character recognition model, using a pinyin recognition model for recognition, when a second symbol is recognized under the pinyin recognition model, using the character recognition model for recognition to obtain the multiple characters and multiple pinyin letters; the pinyin letters of the multiple pinyin letters whose distance is less than or equal to a preset threshold and at least one continuously adjacent pinyin letter are divided into one phonetic symbol to obtain the at least one phonetic symbol, and the start and end coordinates of each phonetic symbol and each character are recorded.

2. The method according to claim 1, characterized in that When the at least one phonetic symbol and the plurality of characters are located in adjacent rows respectively; The step of performing segmentation on the scanned image to obtain a target image comprises: Performing line cutting on the scanned image to obtain at least one intermediate image, each intermediate image comprising a text line and a phonetic notation line; Each of the intermediate images is cut to obtain at least one target image, wherein the target image includes a text image and a phonetic image.

3. The method according to claim 2, characterized in that The step of recognizing the target image to obtain the at least one phonetic symbol and the plurality of characters includes: Using a pinyin recognition model to recognize the phonetic image, to obtain a plurality of pinyin letters in the phonetic image; Divide at least one consecutive adjacent pinyin letter whose distance between the pinyin letters is less than or equal to a threshold value into a phonetic symbol, obtain the at least one phonetic symbol, and record the start and end coordinates of each phonetic symbol; The character image is recognized using a character recognition model to obtain the multiple characters, and the start and end coordinates of each character are recorded.

4. The method according to claim 1 or 3, characterized in that: The starting and ending coordinates of the phonetic symbol overlap completely or partially with the starting and ending coordinates of the candidate characters.

5. The method according to claim 1, characterized in that The starting and ending coordinates of the phonetic notation are adjacent to or separated by N from the starting and ending coordinates of the candidate characters, where N is the number of phonetic notations whose starting and ending coordinates are consecutively adjacent.

6. The method according to claim 5, characterized in that The step of determining the polyphonetic character corresponding to each phonetic symbol from the at least one candidate character corresponding to each phonetic symbol comprises: Obtain all pinyins of each candidate character, and match all pinyins of each candidate character with corresponding phonetic symbols respectively; The candidate characters matching each phonetic symbol are determined as the polyphonetic characters.

7. A polyphonetic character processing device, characterized in that: Applicable to a scanning electronic device having a text recognition function, the device comprising: A collection unit, used for collecting an image of text content including phonetic notation of polyphonetic characters, to obtain a scanned image; An acquisition unit, used for acquiring the scanned image; A line cutting unit, used for cutting the scanned image to obtain a target image, wherein the target image includes at least one phonetic symbol and a plurality of characters; A recognition unit, used for recognizing the target image to obtain at least one phonetic symbol and multiple characters; A determination unit is used to determine the polyphonetic character corresponding to each phonetic from the multiple characters based on the at least one phonetic, comprising: determining at least one candidate character corresponding to each phonetic from the multiple characters based on the start and end coordinates of each phonetic and the start and end coordinates of each character; determining the polyphonetic character corresponding to each phonetic from the at least one candidate character corresponding to each phonetic; A marking unit, used for marking each of the phonetic symbols as the corresponding pinyin of the polyphonetic character; The recognition unit is further used to input the pinyin of the plurality of characters and the polyphonic characters into a translation module and / or a pronunciation module; When the at least one phonetic symbol and the multiple characters are located in the same row; the recognition unit is specifically used to: use the text recognition model to recognize the target image from left to right, when the first symbol is recognized under the text recognition model, use the pinyin recognition model to recognize it, when the second symbol is recognized under the pinyin recognition model, use the text recognition model to recognize it, and obtain the multiple characters and multiple pinyin letters; divide the pinyin letters in the multiple pinyin letters whose distance is less than or equal to a preset threshold and at least one continuously adjacent pinyin letter into one phonetic symbol, obtain the at least one phonetic symbol, and record the start and end coordinates of each phonetic symbol and each character.

8. A scanning electronic device, characterized in that: The method comprises a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and the programs include instructions for executing the steps in the method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: A computer program for electronic data exchange is stored, wherein the computer program enables a computer to execute the method according to any one of claims 1 to 6.