Method, device and server for identifying text data in target language
By using a preset target language processing model, the pictures containing text data of small languages are processed, and the problem of identifying and extracting text data of small languages in the prior art is solved, and high-precision text data recognition and extraction are achieved.
Patent Information
- Application Number
- CN202011328353.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-24
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2040-11-24
AI Technical Summary
It is difficult for the prior art to accurately identify and extract pictures containing text data in small languages such as Thai and Vietnamese, especially in the presence of interference factors.
By preset target language processing model trained with image training data containing interference factors related to the target scenario and/or the target language, the model is called to process the target picture to identify and extract text data of the target language.
The recognition and extraction accuracy of the target language text data is improved, and the text data contained in small languages can be accurately identified and extracted from the target picture in the target scene, reducing processing errors.
Smart Images

Figure CN112541363B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet technology, and more particularly to a method, device and server for identifying text data in a target language. Background Art
[0002] In international data interaction, it is sometimes necessary to identify images containing text data in minority languages such as Thai and Vietnamese, so as to extract the text data in the corresponding language from the image for subsequent data processing.
[0003] Currently, there is an urgent need for a method that can accurately identify and extract text data in minority languages such as Thai and Vietnamese contained in images. Summary of the invention
[0004] The present specification provides a method, device and server for identifying text data in a target language, so as to accurately identify and extract text data in the target language contained in a target image in a target scene.
[0005] The present specification provides a method, device and server for identifying text data in a target language, which are implemented as follows:
[0006] A method for identifying text data in a target language comprises: obtaining a target picture containing text data in a target language in a target scene; calling a preset target language processing model to process the target picture to obtain the text data in the target language in the target picture; wherein the preset target language processing model comprises a model pre-trained using picture training data containing interference factors related to the target scene and / or target language.
[0007] A method for training a target language processing model comprises: generating a target language sentence; constructing picture training data containing interference factors related to the target scene and / or target language according to the target language sentence; and presetting the target language processing model.
[0008] A method for generating picture training data comprises: generating a target language sentence; and constructing picture training data containing interference factors related to the target scene and / or target language according to the target language sentence.
[0009] A device for identifying text data in a target language comprises: an acquisition module for acquiring a target image containing text data in a target language in a target scene; a processing module for invoking a preset target language processing model to process the target image to acquire the text data in the target language in the target image; wherein the preset target language processing model comprises a model pre-trained using image training data containing interference factors related to the target scene and / or target language.
[0010] A server comprises a processor and a memory for storing instructions executable by the processor, wherein when the processor executes the instructions, a target image containing text data in a target language in a target scene is obtained; a preset target language processing model is called to process the target image to obtain the text data in the target language in the target image; wherein the preset target language processing model comprises a model pre-trained using image training data containing interference factors related to the target scene and / or target language.
[0011] The present specification provides a method, device and server for identifying text data in a target language. Before implementation, a preset target language processing model with high accuracy that has learned interference characteristics related to the target scene and the target language can be obtained by pre-training with picture training data containing interference factors related to the target scene and / or the target language. During implementation, the preset target language processing model can be called to process the target picture containing text data in the target language in the acquired target scene, so as to accurately and efficiently identify and extract the required text data in the target language from the target picture. This improves the recognition and extraction accuracy of the text data in the target language, and can accurately identify and extract the text data of small languages such as Thai and Vietnamese contained in the target picture in the target scene. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate the embodiments of this specification, the drawings required for use in the embodiments will be briefly introduced below. The drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0013] Figure 1 It is a schematic diagram of an embodiment of the system structure composition of the target language text data recognition method provided by the embodiment of this specification;
[0014] Figure 2 is a flowchart of a method for recognizing text data in a target language provided by an embodiment of this specification;
[0015] Figure 3 is a schematic diagram of an embodiment of a method for recognizing text data in a target language provided by an embodiment of this specification in a scenario example;
[0016] Figure 4 is a schematic diagram of an embodiment of a method for recognizing text data in a target language provided by an embodiment of this specification in a scenario example;
[0017] Figure 5 is a schematic diagram of an embodiment of a method for recognizing text data in a target language provided by an embodiment of this specification in a scenario example;
[0018] Figure 6 is a flowchart of a method for training a target language processing model provided by an embodiment of this specification;
[0019] Figure 7 It is a schematic diagram of the structure of a server provided by an embodiment of this specification;
[0020] Figure 8 It is a schematic diagram of the structure of a device for recognizing text data in a target language provided by an embodiment of this specification. DETAILED DESCRIPTION
[0021] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.
[0022] The present specification provides a method for identifying text data in a target language. The method for identifying text data in a target language can be applied to a system architecture including a server and a terminal. Figure 1 The terminal and the server can be connected via wired or wireless means to perform specific data interaction.
[0023] Specifically, the terminal may receive a target picture containing text data in a target language in a target scene input by a user, generate a data processing request for the target picture from the target picture, and send the data processing request carrying the target picture to the server.
[0024] The server receives and responds to the data processing request, and calls a preset target language processing model to process the target image, so as to obtain text data of the target language in the target image by identifying and extracting the target image. The preset target language processing model includes a model pre-trained using image training data containing interference factors related to the target scene and / or the target language.
[0025] In this embodiment, the server may specifically include a background server applied to a data processing platform side that can realize functions such as data transmission and data processing. Specifically, the server may be, for example, an electronic device with data calculation, storage and network interaction functions. Alternatively, the server may also be a software program running in the electronic device to provide support for data processing, storage and network interaction. In this embodiment, the number of servers included in the server is not specifically limited. The server may specifically be one server, or several servers, or a server cluster formed by several servers.
[0026] In this embodiment, the terminal may specifically include a front-end electronic device applied to the user side and capable of realizing functions such as data collection and data transmission. Specifically, the terminal may be, for example, a desktop computer, a tablet computer, a laptop computer, a smart phone, etc. Alternatively, the terminal may also be a software application that can be run in the above electronic devices. For example, it may be an APP running on a smart phone.
[0027] For example, in an online identity verification scenario, a user can use a mobile phone as a terminal, take a photo of a target certificate (e.g., ID card, passport, etc.) in the target language according to the prompt information in the identity verification interface displayed by the mobile phone, and send the photo as the target image to the server responsible for online identity verification.
[0028] Accordingly, the server can receive the ID photo sent by the user via the mobile phone, and call the preset target language processing model to perform OCR processing on the ID photo, so as to recognize and extract text data of the ID number, name, nationality and other identity information of the user described in the target language from the ID photo.
[0029] Furthermore, the server may query the online user database to obtain the user data that the user previously registered and stored in the user database, and perform a data comparison using the user data and the identified and extracted text data to obtain a corresponding comparison result.
[0030] Based on the comparison result, if the server determines that the difference between the two data is less than or equal to the preset difference threshold, it can determine that the user identity authentication has passed, and feedback a prompt message indicating that the identity authentication has passed to the mobile phone used by the user.
[0031] Conversely, according to the comparison result, if it is determined that the difference between the two data is greater than the preset difference threshold, it can be determined that the user identity authentication has failed, and a prompt message indicating that the identity authentication has failed is fed back to the mobile phone used by the user.
[0032] See also Figure 2 As shown, the embodiment of this specification provides a method for identifying text data in a target language, wherein the method is specifically applied to a server side. When implemented specifically, the method may include the following contents.
[0033] S201: Acquire a target image containing text data in a target language in a target scene.
[0034] In some embodiments, the target language may be specifically understood as a minority language that is different from commonly used languages (eg, English, Chinese, etc.) and is used by relatively fewer people and in relatively limited areas.
[0035] Specifically, the target language may be Thai, Vietnamese, Burmese, etc.
[0036] In some embodiments, the target image may be specifically understood as image data related to a target scene and containing text data in a target language to be recognized and extracted.
[0037] In some embodiments, the target scenario may specifically include: an online identity information verification scenario, a content translation scenario of a product details page on a shopping website, a text data extraction scenario in a photo, and the like.
[0038] Specifically, taking the online identity authentication scenario as an example, the user can take a photo of an ID card (or other document that can indicate the user's identity) in the target language through the terminal according to the instructions, and send the ID card photo to the server.
[0039] Accordingly, the server can receive the ID card photo sent by the user through the terminal as the target image. Subsequently, the server can process the target image accordingly to identify and extract the text data of the user's identity information data (for example, the user's ID card number, the user's name, etc.) described in the target language in the image; then use the above text data to compare with the user data corresponding to the user stored in the user database to achieve online identity verification of the user.
[0040] Take the content translation scenario of the product details page of a shopping website as an example. Usually in the target area where the target language is used, the product details page of the shopping website mostly uses the target language commonly used locally to describe the content details of the products displayed on the page. Users who do not understand the target language (for example, from other areas where other languages are used, tourists traveling in the target area, etc.) cannot understand the content details described on the above page of the shopping website when using a terminal to browse the shopping website in the target area. At this time, the terminal used by the user can respond to the user's instructions, obtain a screenshot of the current page by taking a screenshot, and send the screenshot to the server.
[0041] Accordingly, the server can receive the page screenshot sent by the user through the terminal as the target image. Subsequently, the server can process the target screenshot accordingly to identify and extract the text data of the content details of the product described in the target language in the image; then use the translation model to translate the above text data to obtain the translated text data; and then the service can feed back the translated text data to the terminal device.
[0042] In this way, the terminal device can display the translated text data on the page so that the user can understand the content details of the product described on the page.
[0043] Of course, it should be noted that the application scenarios listed above are only schematic illustrations. In specific implementation, according to specific circumstances and processing requirements, the target scenarios may also include other types of application scenarios. This specification does not limit this.
[0044] S202: Calling a preset target language processing model to process the target image to obtain text data of the target language in the target image; wherein the preset target language processing model includes a model pre-trained using image training data containing interference factors related to the target scene and / or target language.
[0045] In some embodiments, the preset target language processing model can be specifically understood as an OCR (Optical Character Recognition) model that is pre-trained using image training data containing interference factors related to the target scene and / or the target language. Based on this model, the part of the text data in the target scene described in the target language can be identified and extracted from the target image.
[0046] In some embodiments, corresponding to different target scenes, the interference factors related to the target scenes may include different types of interference factors.
[0047] Specifically, for example, when the target scenario is an online identity verification scenario, refer to Figure 3 As shown, the interference factors related to the target scene may include: marks formed by the coating (e.g., plastic coating) provided on the ID card (e.g., the texture of the coating itself, the light spot pattern formed by the reflection of the coating, etc.), the background pattern on the ID card, etc. In addition, the interference factors related to the target scene may further include watermark information on the ID card, photo patterns on the ID card, and other data that may interfere with and affect the recognition and extraction of text data.
[0048] For another example, when the target scene is a content translation scene of a product details page on a shopping website, the interference factors related to the target scene may include: the background color of the page, the background pattern of the page, icons floating on the page, and the like.
[0049] Usually, when the model performs recognition processing on a target image containing the above-mentioned interference factors related to the target scene, it is easy to mistakenly recognize the above-mentioned interference factors in the target image as target language characters, resulting in errors in the recognized and extracted target text data.
[0050] In some embodiments, corresponding to different target languages, the interference factors related to the target languages may also include different types of interference factors.
[0051] Specifically, take Thai as an example. Figure 4 As shown. The structure of Thai characters is often complex. For example, for a Thai character, there may be a character mark (e.g., a tone mark) above the character, or a character mark (e.g., a character mark of a vowel character) below the character, etc. Moreover, different character marks often have a great impact on the semantic understanding of Thai.
[0052] Usually, when the model recognizes a Thai sentence in a certain line (recorded as the current line) of a target image containing multiple lines of Thai sentences arranged in a vertical direction, you can refer to Figure 4 As shown, it is easy to mistakenly identify the character markers located below the characters in the Thai sentence in the previous line adjacent to the current line, and / or the character markers located above the characters in the Thai sentence in the next line adjacent to the current line as the character markers of the Thai sentence in the current line, resulting in errors in the recognition of the extracted Thai text data.
[0053] In this embodiment, the preset target language processing model used is a model trained using image training data containing interference factors related to the target scene and / or the target language. Therefore, when processing the target image in the target scene based on the model, the error caused by the interference factors based on the target scene and / or the interference factors based on the target language can be effectively reduced, so that the text data of the target language can be more accurately recognized and extracted from the target image.
[0054] In some embodiments, during specific implementation, after receiving the target image, the server may trigger the call of a preset target language processing model to process the target image. Specifically, the server may input the target image as a model input into the preset target language processing model, and run the preset target language processing model to obtain the corresponding model output. Then, according to the model output, the text data of the target language recognized and extracted from the target image is obtained.
[0055] Furthermore, the server may use the text data in the target language to perform relevant data processing.
[0056] Specifically, for example, in an online identity information verification scenario, the server can authenticate the user by comparing the text data in the target language obtained from the ID card photo with the user data stored in the user database.
[0057] For another example, in the content translation scenario of a product details page on a shopping website, the server can translate the text data in the target language obtained from the page screenshot to obtain translated text data; and feed the translated text data back to the user so that the user can understand the product content details displayed on the current page.
[0058] As can be seen from the above, the method for identifying text data in a target language provided in the embodiments of the present specification processes a target image containing text data in the target language in the acquired target scene by calling a preset target language processing model that is pre-trained using image training data containing interference factors related to the target scene and / or the target language, thereby accurately identifying and extracting text data in the target language from the target image, reducing processing errors, and improving the recognition accuracy of text data in the target language.
[0059] In some embodiments, since the target languages are mostly minority languages with relatively few users and a relatively limited scope of use, the corpus data (or training data) that can be collected for training the preset target language processing model is relatively small, which in turn affects the model accuracy of the preset target language processing model obtained through training.
[0060] In this embodiment, the server can first generate a target language sentence in the form of text data, and then synthesize and construct a picture containing interference factors related to the target scene and / or target language based on the target language sentence as picture training data for model training, thereby effectively expanding the picture training data used to train the preset target language processing model, and then using the above-mentioned richer picture training data to train a preset target language processing model with relatively high model accuracy.
[0061] In some embodiments, the preset target language processing model can be trained specifically in the following manner: generate a target language sentence; based on the target language sentence, construct picture training data containing interference factors related to the target scene and / or target language; use the picture training data to train an initial model to obtain the preset target language processing model.
[0062] Through the above embodiment, the target language sentences in the form of text data can be automatically generated first, and then picture training data in the form of pictures can be constructed based on the above target language sentences, so as to effectively expand the picture training data used for model training; and then the above rich picture training data can be used to train a preset target language processing model with relatively better effect and relatively higher accuracy.
[0063] In some embodiments, the generating of the target language sentence may include the following contents during specific implementation: determining a starting target language character; calling a preset target language sentence generation model to predict a connecting target language character and an ending target language character based on the starting target language character; wherein the preset target language sentence generation model is used to predict the next target language character connected to the input target language character in the sentence; and concatenating the starting target language character, the connecting target language character, and the ending target language character to obtain the target language sentence.
[0064] In some embodiments, the target language sentence may be specifically understood as a sentence or phrase in a text form using the target language.
[0065] Specifically, the target language sentence may include a sentence with a complete syntactic structure. The target language sentence may also include a sentence or phrase with an incomplete syntactic structure that allows for partial structural omissions in spoken language but does not affect the overall semantics.
[0066] In some embodiments, the starting target language character can be specifically understood as the first target language character in the target language sentence. The ending target language character can be specifically understood as the last target language character in the target language sentence. The connecting target language character can be specifically understood as the target language character connected to the previous character in the target language sentence.
[0067] In some embodiments, the above determination of the starting target language character may include the following when implemented specifically: obtaining historical text data related to the target scenario; wherein the historical text data includes multiple historical target language sentences; counting the first characters of the historical target language sentences in the historical text data to obtain the frequency of occurrence of the first character; and determining the starting target language character based on the frequency of occurrence of the first character.
[0068] In this embodiment, the above method can be used to select and use the first character with a higher frequency of appearance in the target scene as the starting target language character of the target language sentence according to the frequency of appearance of the first character. Based on the above starting target language character, a sentence that can better match the simulated target scene and is used more frequently in the target scene can be generated as the target language sentence.
[0069] In some embodiments, when generating a target language sentence specifically based on an initial target language character, a pre-trained target language sentence generation model can be used to predict the next target language character connected to the initial target language character (i.e., the connecting character of the target language character, recorded as the second character) based on the initial target language character. Then, the target language sentence generation model is used to predict the next target language character connected to the second character (i.e., the connecting character of the second character, recorded as the third character) based on the second character. The above method can be used in the same manner. When the target language sentence generation model is used to predict the next target language character connected to the Nth character based on the Nth character, if no suitable connecting character is found, the Nth character can be determined as the interpreted target language character.
[0070] The above-mentioned preset target language sentence generation model can be specifically understood as a model that is obtained by pre-training and learning with a large amount of historical text data related to the target scenario and using the target language, and can predict the connection probability between different target language characters in a sentence.
[0071] In some embodiments, the above-mentioned preset target language sentence generation model can be specifically trained in the following manner: obtaining historical text data related to the target scenario; splitting a plurality of historical target language sentences and historical target language words from the historical text data; and performing model training using the plurality of historical target language sentences and historical target language words to obtain the preset target language sentence generation model.
[0072] By training the model in the above manner, the model can learn the combination and usage rules of the target language characters in the target language sentences used in the target scenario. When the model is subsequently run, the connection probability of each target language character and the target language character currently input into the model can be predicted based on the above combination and usage rules; and the target language characters with connection probabilities greater than a preset probability threshold are selected as the target language characters connected to the target language characters currently input into the model, and output.
[0073] In some embodiments, the identification information of the starting target language character, the connecting target language character, and the ending target language character may be arranged and concatenated in order to obtain a target language sentence.
[0074] Through the above embodiments, a large number of target language sentences matching the target scenario can be regenerated without relying on the corpus of text data in the target language.
[0075] In some embodiments, during implementation, a corpus of text data in the target language may be obtained, and sentences or phrases in text form related to the target scenario may be retrieved from the corpus of text data in the target language as the target language sentence, so that the required target language sentence can be obtained relatively quickly.
[0076] In some embodiments, interference factors related to the target language may specifically include: character marks below the target language characters in the target language sentence in the adjacent upper line, and / or character marks above the target language characters in the target language sentence in the adjacent lower line.
[0077] Specifically, taking Thai as an example, the structure of Thai characters is often complex. For example, for a Thai character, there may be a character mark above the character, or there may be a character mark below the character, etc. Specifically, the above character marks may include: tone marks, character marks with vowels, character marks with consonants, and other marks of different types and meanings. Moreover, different character marks often have a greater impact on the semantic understanding of Thai.
[0078] Usually, when the model recognizes and processes Thai sentences in a certain line (denoted as the current line) of a target image containing multiple lines of Thai sentences arranged in a vertical direction, it is easy to mistakenly recognize the character marks located below the characters in the Thai sentence in the previous line adjacent to the current line, and / or the character marks located above the characters in the Thai sentence in the next line adjacent to the current line as character marks of the Thai sentence in the current line, resulting in errors in the recognized and extracted Thai text data.
[0079] In order to effectively avoid the above-mentioned errors, in this embodiment, a picture containing interference factors related to the target language can be constructed and used as picture training data to train the model. The model trained in this way can effectively eliminate the interference and influence of interference factors related to the target language, such as character marks below the target language characters in the target language sentence in the adjacent upper line, or character marks above the target language characters in the target language sentence in the adjacent lower line, on the target language sentence in the current line that is actually to be identified and extracted, in the process of identifying and extracting text data in the target picture, so that the corresponding target language sentence can be identified and extracted more accurately.
[0080] In some embodiments, the above-mentioned construction of the image training data containing interference factors related to the target language based on the target language sentences may include the following contents when implemented: according to a preset processing rule, a plurality of target language sentences are arranged in a vertical direction; a preset rendering tool is called to generate a first image containing a plurality of lines of target language sentences arranged in a vertical direction; according to a preset interception rule, screenshots containing each line of the plurality of lines of target language sentences arranged in the vertical direction are intercepted from the first image as the image training data containing interference factors related to the target language; wherein the screenshot contains character marks located below the target language characters in the target language sentence in the previous line adjacent to the target language sentence in the current line corresponding to the screenshot, and / or character marks located above the target language characters in the target language sentence in the next line adjacent to the target language sentence in the current line corresponding to the screenshot.
[0081] For details, see Figure 5As shown, a screenshot of the target language sentence of the current line in the first image (abbreviated as the screenshot of the current line) is taken as an example. According to the preset interception rule, a screenshot of the target language sentence of the complete current line, as well as part or all of the character marks below the characters in the previous line of the sentence adjacent to the current line, and / or part or all of the character marks above the characters in the next line of the sentence adjacent to the current line can be intercepted from the first image as the screenshot of the current line. And the above-mentioned screenshot of the current line is determined as a picture training data containing the target language sentence of the current line.
[0082] In this embodiment, the above-mentioned preset rendering tool can be specifically understood as an application program for rendering text data in a text form to generate corresponding image data in a picture form.
[0083] In some embodiments, the interference factors related to the target scene may specifically include at least one of the following: watermark information, film imprint, background pattern, etc. Of course, it should be noted that the interference factors related to the target scene listed above are only a schematic illustration. During specific implementation, according to specific application scenarios and processing requirements, the interference factors related to the target scene may also include other types of interference factors. This specification does not limit this.
[0084] Usually, when the model performs recognition processing on a target image containing the above-mentioned interference factors related to the target scene, it is easy to mistakenly recognize the above-mentioned interference factors in the target image as target language characters, resulting in errors in the recognized and extracted target text data.
[0085] In order to effectively avoid the above errors, in this embodiment, pictures containing interference factors related to the target scene can be constructed and used as picture training data to train the model. In the process of identifying and extracting text data in the target picture, the model trained in this way can effectively eliminate the interference and influence of interference factors related to the target scene such as watermark information, lamination marks, etc. in the target picture on the identification and extraction of the target language sentence, so that the corresponding target language sentence can be more accurately identified and extracted.
[0086] In some embodiments, the above-mentioned construction of picture training data containing interference factors related to the target scene based on the target language sentence may include the following contents during specific implementation: determining the interference factors related to the target scene based on the target scene; generating a foreground image and / or background image matching the target scene based on the interference factors related to the target scene; and combining the foreground image and / or background image with the picture training data to obtain picture training data containing interference factors related to the target scene.
[0087] In some embodiments, it is considered that handwritten text data of the target language may appear in some target scenes. For example, in offline retail stores, merchants may use handwritten signs or advertisements. Furthermore, it is considered that for target languages such as Thai and Vietnamese, the character structure itself is relatively complex, and the handwritten ones are relatively more complex. In order to be able to train a model that can more accurately identify and extract the target text data in the target image, during model training, pictures containing handwritten target language sentences can also be introduced and used as a kind of picture training data to participate in the training of the model.
[0088] In some embodiments, after constructing picture training data containing interference factors related to the target scene and / or target language based on the target language sentence, the method, when implemented, may also include: generating a handwritten target language sentence based on the target language sentence in the picture training data; and constructing picture training data containing interference factors related to the target scene and / or target language based on the handwritten target language sentence.
[0089] In this embodiment, before implementation, a large amount of handwritten text data in the target scene can be obtained, and the handwritten version corresponding to each target language character can be determined based on the handwritten text data. During implementation, the characters of the corresponding handwritten version can be found and replaced accordingly based on each target language character included in the target language sentence in the image training data, so as to obtain the handwritten target language sentence.
[0090] Furthermore, image training data containing interference factors related to the target scene and / or target language can be constructed based on the above handwritten target language sentences. The above image training data containing handwritten target language sentences are mixed with the image training data containing non-handwritten target language sentences, and the mixed image training data are used for model training, so that a target language processing model that can more accurately recognize and extract text data of the handwritten target language and text data of the non-handwritten target language from the target image can be obtained.
[0091] In some embodiments, after relatively rich image training data is constructed in the above manner, the image training data can be used to train an initial model to obtain a preset target language processing model.
[0092] In some embodiments, the initial model may specifically include a neural network model based on a CRNN framework, wherein the CRNN may specifically be understood as a neural network structure that simultaneously integrates a CNN (Convolutional Neural Networks) network structure, an RNN (Recurrent Neural Networks) network structure, and a CTC (Connectionist temporal classification) network structure.
[0093] Specifically, the above-mentioned initial model based on the CRNN framework may include three network layers, namely the first network layer, the second network layer and the third network layer. Among them, the first network layer (for example, Convolutional Layers) is used to extract the image features of each character from the picture of the input model. The second network layer (for example, Recurrent Layers) is used to determine the corresponding time series features by analyzing the time relationship between two adjacent characters based on the image features of each input character. The third network layer (for example, Transcription Layer) is used to translate the corresponding text data by mapping based on the input time series features.
[0094] In this embodiment, the above-mentioned initial model based on the CRNN framework can be used to learn the picture training data containing interference factors related to the target scene and / or the target language based on deep learning to train a preset target language processing model. The preset target language processing model obtained by such training has better robustness in OCR recognition and relatively higher model accuracy.
[0095] In some embodiments, the target scenario may specifically include at least one of the following: an online identity information verification scenario, a content translation scenario of a product details page on a shopping website, a text data extraction scenario in a photo, etc.
[0096] In some embodiments, when the target scenario includes an online identity information verification scenario, the target image may specifically include a user's ID card photo, and the acquired text data may include user identity information data. The ID card may specifically be an ID card in the target language. The user identity information data may specifically include the user's name, ID card number, and other information described in the target language, which is identified and extracted from the user's ID card photo.
[0097] In some embodiments, after obtaining the text data in the target language in the target image, the method may further include the following when implemented: authenticating the user by comparing the text data with the user data stored in the corresponding user database.
[0098] As can be seen from the above, the method for identifying text data in the target language provided in the embodiment of this specification is based on this method. Before specific implementation, the image training data containing interference factors related to the target scene and / or the target language can be used in advance to train the preset target language processing model that has learned the interference characteristics related to the target scene and the target language and has a high accuracy; during specific implementation, the target image containing text data in the target language in the acquired target scene can be processed by calling the above preset target language processing model to identify and extract the text data in the target language from the target image. Thereby, the recognition accuracy of the text data in the target language is improved, and the text data of small languages such as Thai and Vietnamese contained in the target image under the target scene can be accurately identified and extracted.
[0099] See also Figure 6 As shown, the embodiment of this specification also provides a method for training a target language processing model. When the method is implemented specifically, it may include the following contents.
[0100] S601: Generate target language sentences.
[0101] S602: Constructing picture training data including interference factors related to the target scene and / or target language according to the target language sentence.
[0102] S603: Using the image training data to train an initial model to obtain a preset target language processing model.
[0103] In this embodiment, the target language may be Thai, Vietnamese, Burmese or other minority languages.
[0104] Through the above-mentioned embodiment, it is possible to first generate image training data that takes into account interference factors of the target scene and the target language, and then use the above-mentioned image training data to train a preset target language processing model that has better effect and higher accuracy and is suitable for the recognition and extraction of target language text data for images in the target scene.
[0105] In some embodiments, the generating of the target language sentence may include the following contents during specific implementation: determining a starting target language character; calling a preset target language sentence generation model to predict a connecting target language character and an ending target language character based on the starting target language character; wherein the preset target language sentence generation model is used to predict the next target language character connected to the input target language character in the sentence; and concatenating the starting target language character, the connecting target language character, and the ending target language character to obtain the target language sentence.
[0106] In some embodiments, the interference factors related to the target language may specifically include: character marks below the target language characters in the target language sentence in the adjacent previous line, and / or character marks above the target language characters in the target language sentence in the adjacent next line, etc.
[0107] In some embodiments, the above-mentioned construction of the image training data containing interference factors related to the target language based on the target language sentences may include the following contents during specific implementation: arranging multiple target language sentences in a vertical direction; calling a preset rendering tool to generate a first image containing multiple lines of target language sentences arranged in the vertical direction; according to a preset interception rule, intercepting from the first image screenshots containing each line of the multiple lines of target language sentences arranged in the vertical direction as the image training data containing interference factors related to the target language; wherein the screenshot contains character marks located below the target language characters in the target language sentence in the previous line adjacent to the target language sentence in the current line corresponding to the screenshot, and / or, character marks located above the target language characters in the target language sentence in the next line adjacent to the target language sentence in the current line corresponding to the screenshot.
[0108] The embodiment of this specification also provides a method for generating image training data to expand the image training data used for model training. When the method is implemented specifically, it may include the following contents.
[0109] S1: Generate target language sentences.
[0110] S2: constructing picture training data containing interference factors related to the target scene and / or target language according to the target language sentence.
[0111] Through the above-mentioned embodiments, when performing data modeling related to minority languages such as Thai and Vietnamese, a large amount of rich image training data that fits the specific target scene and has good training effect can be generated by itself, thereby effectively solving the problem that minority languages are limited by the number of users and the scope of use, resulting in the limitation of the training data that can be collected, which affects data modeling.
[0112] In some embodiments, the generating of the target language sentence may include: determining a starting target language character; calling a preset target language sentence generation model to predict a connecting target language character and an ending target language character based on the starting target language character; wherein the preset target language sentence generation model is used to predict the next target language character connected to the input target language character in the sentence; and concatenating the starting target language character, the connecting target language character, and the ending target language character to obtain the target language sentence.
[0113] In some embodiments, interference factors related to the target language may specifically include: character marks below the target language characters in the target language sentence in the adjacent previous line, and / or character marks above the target language characters in the target language sentence in the adjacent next line, etc.
[0114] In some embodiments, the above-mentioned construction of the image training data containing interference factors related to the target language based on the target language sentences may include: arranging multiple target language sentences in a vertical direction; calling a preset rendering tool to generate a first image containing multiple lines of target language sentences arranged in the vertical direction; according to a preset interception rule, intercepting from the first image screenshots containing each line of the multiple lines of target language sentences arranged in the vertical direction as the image training data containing interference factors related to the target language; wherein the screenshot contains character marks located below the target language characters in the target language sentence in the previous line adjacent to the target language sentence in the current line corresponding to the screenshot, and / or, character marks located above the target language characters in the target language sentence in the next line adjacent to the target language sentence in the current line corresponding to the screenshot.
[0115] The embodiments of the present specification also provide a server, including a processor and a memory for storing instructions executable by the processor. When the processor is implemented, it can perform the following steps according to the instructions: obtain a target image containing text data in a target language in a target scene; call a preset target language processing model to process the target image to obtain the text data in the target language in the target image; wherein the preset target language processing model includes a model pre-trained using image training data containing interference factors related to the target scene and / or target language.
[0116] In order to complete the above instructions more accurately, refer to Figure 7 As shown, the embodiment of this specification also provides another specific server, wherein the server includes a network communication port 701, a processor 702 and a memory 703, and the above structures are connected through internal cables so that each structure can perform specific data interaction.
[0117] The network communication port 701 may be used to obtain a target image containing text data in a target language in a target scene.
[0118] The processor 702 can be specifically used to call a preset target language processing model to process the target image to obtain text data of the target language in the target image; wherein the preset target language processing model includes a model pre-trained using image training data containing interference factors related to the target scene and / or target language.
[0119] The memory 703 may be specifically used to store corresponding instruction programs.
[0120] In this embodiment, the network communication port 701 can be a virtual port that is bound to different communication protocols so that different data can be sent or received. For example, the network communication port can be a port responsible for web data communication, a port responsible for FTP data communication, or a port responsible for email data communication. In addition, the network communication port can also be a physical communication interface or communication chip. For example, it can be a wireless mobile network communication chip, such as GSM, CDMA, etc.; it can also be a Wifi chip; it can also be a Bluetooth chip.
[0121] In this embodiment, the processor 702 may be implemented in any appropriate manner. For example, the processor may take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) executable by the (micro)processor, a logic gate, a switch, an application specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller, etc. This specification does not limit this.
[0122] In this embodiment, the memory 703 may include multiple levels. In a digital system, anything that can store binary data can be a memory; in an integrated circuit, a circuit with a storage function that has no physical form is also called a memory, such as RAM, FIFO, etc.; in a system, a storage device with a physical form is also called a memory, such as a memory stick, TF card, etc.
[0123] The embodiments of this specification also provide a computer storage medium based on the above-mentioned target language text data recognition method, wherein the computer storage medium stores computer program instructions, which, when executed, implement: obtaining a target image containing text data in the target language in a target scene; calling a preset target language processing model to process the target image to obtain the target language text data in the target image; wherein the preset target language processing model includes a model pre-trained using image training data containing interference factors related to the target scene and / or target language.
[0124] In this embodiment, the storage medium includes, but is not limited to, a random access memory (RAM), a read-only memory (ROM), a cache, a hard disk (HDD), or a memory card. The memory may be used to store computer program instructions. The network communication unit may be an interface for network connection communication set in accordance with the standard specified by the communication protocol.
[0125] In this embodiment, the functions and effects specifically implemented by the program instructions stored in the computer storage medium can be explained in comparison with other implementations and will not be described in detail here.
[0126] See also Figure 8 As shown, at the software level, the embodiment of this specification also provides a device for recognizing text data in a target language, and the device may specifically include the following structural modules.
[0127] The acquisition module 801 may be specifically used to acquire a target image containing text data in a target language in a target scene.
[0128] The processing module 802 can be specifically used to call a preset target language processing model to process the target image to obtain text data of the target language in the target image; wherein the preset target language processing model includes a model pre-trained using image training data containing interference factors related to the target scene and / or target language.
[0129] In some embodiments, the target language may specifically include at least one of the following: Thai, Vietnamese, Burmese, etc.
[0130] In some embodiments, the device may further specifically include a training module for training a preset target language processing model in the following manner: generating a target language sentence; constructing picture training data containing interference factors related to the target scene and / or target language based on the target language sentence; and using the picture training data to train an initial model to obtain the preset target language processing model.
[0131] In some embodiments, the training module can specifically generate a target language sentence in the following manner: determine a starting target language character; call a preset target language sentence generation model to predict a connecting target language character and an ending target language character based on the starting target language character; wherein the preset target language sentence generation model is used to predict the next target language character connected to the input target language character in the sentence; and concatenate the starting target language character, the connecting target language character, and the ending target language character to obtain the target language sentence.
[0132] In some embodiments, the training module can specifically determine the starting target language character in the following manner: obtain historical text data related to the target scenario; wherein the historical text data includes multiple historical target language sentences; count the first characters of the historical target language sentences in the historical text data to obtain the frequency of occurrence of the first character; and determine the starting target language character based on the frequency of occurrence of the first character.
[0133] In some embodiments, interference factors related to the target language may specifically include: character marks below the target language characters in the target language sentence in the adjacent previous line, and / or character marks above the target language characters in the target language sentence in the adjacent next line, etc.
[0134] In some embodiments, when the training module is specifically implemented, the image training data containing interference factors related to the target language can be constructed in the following manner: according to a preset processing rule, a plurality of target language sentences are arranged in a vertical direction; a preset rendering tool is called to generate a first image containing a plurality of lines of target language sentences arranged in a vertical direction; according to a preset interception rule, screenshots containing each line of the plurality of lines of target language sentences arranged in the vertical direction are intercepted from the first image as the image training data containing interference factors related to the target language; wherein the screenshot contains character marks located below the target language characters in the target language sentence in the previous line adjacent to the target language sentence in the current line corresponding to the screenshot, and / or character marks located above the target language characters in the target language sentence in the next line adjacent to the target language sentence in the current line corresponding to the screenshot.
[0135] In some embodiments, the interference factors related to the target scene may specifically include at least one of the following: watermark information, a film imprint, a background pattern, etc.
[0136] In some embodiments, when the training module can be implemented specifically, picture training data containing interference factors related to the target scene can be constructed in the following manner: according to the target scene, the interference factors related to the target scene are determined; according to the interference factors related to the target scene, a foreground image and / or background image matching the target scene is generated; and the foreground image and / or background image are combined with the picture training data using the foreground image and / or background image to obtain picture training data containing interference factors related to the target scene.
[0137] In some embodiments, when the training module is specifically implemented, after constructing picture training data containing interference factors related to the target scene and / or target language according to the target language sentence, it can also be used to construct picture training data containing handwritten target language sentences in the following manner: generating handwritten target language sentences according to the target language sentences in the picture training data; and constructing picture training data containing interference factors related to the target scene and / or target language according to the handwritten target language sentences.
[0138] In some embodiments, the initial model used by the training module when training a preset target language processing model may specifically include a neural network model based on a CRNN framework.
[0139] In some embodiments, the target scenario may specifically include at least one of the following: an online identity information verification scenario, a content translation scenario of a product details page on a shopping website, a text data extraction scenario in a photo, etc.
[0140] In some embodiments, when the target scenario includes an online identity information verification scenario, the target image may specifically include a user's ID card photo, and the acquired text data may specifically include user identity information data.
[0141] In some embodiments, after acquiring the text data in the target language in the target image, the device may also be used to authenticate the user by comparing the text data with the user data stored in the corresponding user database.
[0142] It should be noted that the units, devices or modules described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. For the convenience of description, the above devices are described separately by functions divided into various modules. Of course, when implementing this specification, the functions of each module can be implemented in the same or more software and / or hardware, or the modules that implement the same function can be implemented by a combination of multiple sub-modules or sub-units. The device embodiments described above are only schematic. For example, the division of the units 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, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0143] The embodiments of the present specification also provide a training device for a target language processing model, including: a generation module, which can be specifically used to generate target language sentences; a construction module, which can be specifically used to construct picture training data containing interference factors related to the target scene and / or target language based on the target language sentences; and a training module, which can be specifically used to train an initial model using the picture training data to obtain a preset target language processing model.
[0144] The embodiments of the present specification also provide a device for generating image training data, including: a generation module, which can be specifically used to generate a target language sentence; a construction module, which can be specifically used to construct image training data containing interference factors related to the target scene and / or target language based on the target language sentence.
[0145] As can be seen from the above, the target language text data recognition device provided in the embodiment of this specification can process the target picture containing the target language text data in the acquired target scene by calling the preset target language processing model trained with the picture training data containing interference factors related to the target scene and / or the target language, so as to recognize and extract the target language text data from the target picture. Thereby, the recognition accuracy of the target language text data is improved, and the text data of small languages such as Thai, Vietnamese, etc. contained in the target picture under the target scene can be accurately recognized and extracted.
[0146] Although the present specification provides method operation steps as described in the embodiments or flow charts, more or less operation steps may be included based on conventional or non-creative means. The order of steps listed in the embodiments is only one way of executing the order of many steps, and does not represent a unique execution order. When the device or client product in practice is executed, it can be executed in sequence or in parallel according to the method shown in the embodiments or the drawings (for example, a parallel processor or a multi-threaded processing environment, or even a distributed data processing environment). The term "include", "include" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, product or device including a series of elements includes not only those elements, but also includes other elements that are not explicitly listed, or also includes elements inherent to such a process, method, product or device. In the absence of more restrictions, it is not excluded that there are other identical or equivalent elements in the process, method, product or device including the elements. The first, second, etc. words are used to represent the name, and do not represent any particular order.
[0147] Those skilled in the art also know that, in addition to implementing the controller in a purely computer-readable program code, the controller can be made to implement the same function in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, such a controller can be considered as a hardware component, and the devices for implementing various functions included therein can also be considered as structures within the hardware component. Or even, the devices for implementing various functions can be considered as both software modules for implementing the method and structures within the hardware component.
[0148] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, classes, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media including storage devices.
[0149] Through the description of the above embodiments, it can be known that those skilled in the art can clearly understand that the present specification can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present specification can essentially be embodied in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a mobile terminal, a server, or a network device, etc.) to execute the methods described in each embodiment of the present specification or some parts of the embodiments.
[0150] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. This specification can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld devices or portable devices, tablet devices, multi-processor systems, microprocessor-based systems, set-top boxes, programmable electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc.
[0151] Although the present specification is described through embodiments, those skilled in the art will appreciate that there are many modifications and changes to the present specification without departing from the spirit of the present specification, and it is intended that the appended claims include these modifications and changes without departing from the spirit of the present specification.
Claims
1. A method for identifying text data in a target language, comprising: Acquire a target image containing text data in a target language in a target scene; wherein the target language is a minority language with a small number of speakers and a limited area of use; Calling a preset target language processing model to process the target image to obtain text data of the target language in the target image; wherein the preset target language processing model includes a model pre-trained using the constructed image training data that at least contains interference factors related to the target language; The language-related interference factors include: character marks below the target language characters in the target language sentence in the adjacent upper line, and / or character marks above the target language characters in the target language sentence in the adjacent lower line; the character marks include: tone marks, character marks of vowels, and character marks of consonants; the target language sentences include: sentences with complete syntactic structures, and sentences or phrases with incomplete syntactic structures that allow partial structural omissions in spoken language but do not affect the overall semantics; The target language sentence is generated in the following manner: Determine a starting target language character; call a preset target language sentence generation model to predict a connecting target language character and an ending target language character according to the starting target language character; concatenate the starting target language character, the connecting target language character, and the ending target language character to obtain the target language sentence; wherein the preset target language sentence generation model is a model that is obtained by training and learning in advance using historical text data related to the target scenario and using the target language, and can predict the connection probability between different target language characters in a sentence; And, obtaining a corpus of text data in the target language; retrieving sentences or phrases in text form related to the target scenario from the corpus of text data in the target language as the target language sentences.
2. The method according to claim 1, wherein the target language comprises at least one of the following: Thai, Vietnamese, and Burmese.
3. According to the method of claim 2, the preset target language processing model is trained in the following manner: Generate target language sentences; According to the target language sentence, constructing picture training data containing interference factors related to the target scene and / or target language; The image training data is used to train an initial model to obtain the preset target language processing model.
4. The method according to claim 3, wherein generating a target language sentence comprises: Determine the starting target language characters; Calling a preset target language sentence generation model to predict the connecting target language character and the ending target language character according to the starting target language character; wherein the preset target language sentence generation model is used to predict the next target language character connected to the input target language character in the sentence; The target language sentence is obtained by concatenating the starting target language characters, the connecting target language characters, and the ending target language characters.
5. The method according to claim 4, wherein determining the starting target language character comprises: Acquire historical text data related to the target scenario; wherein the historical text data includes a plurality of historical target language sentences; Counting the first characters of the historical target language sentences in the historical text data to obtain the occurrence frequency of the first characters; According to the occurrence frequency of the first character, the starting target language character is determined.
6. The method according to claim 1, wherein constructing picture training data containing interference factors related to the target language according to the target language sentence comprises: Arrange multiple target language sentences in vertical direction; Calling a preset rendering tool to generate a first image including a plurality of target language sentences arranged in a vertical direction; According to a preset clipping rule, screenshots each containing a line of target language sentences in the multiple lines of target language sentences arranged in the vertical direction are clipped from the first image as image training data containing interference factors related to the target language; wherein the screenshot contains character marks below the target language characters in the target language sentence in the previous line adjacent to the target language sentence in the current line corresponding to the screenshot, and / or character marks above the target language characters in the target language sentence in the next line adjacent to the target language sentence in the current line corresponding to the screenshot.
7. According to the method of claim 3, the interference factors related to the target scene include at least one of the following: watermark information, film imprint, and background pattern.
8. The method according to claim 7, wherein constructing picture training data containing interference factors related to the target scene according to the target language sentence comprises: According to the target scenario, determining interference factors related to the target scenario; generating a foreground image and / or a background image matching the target scene according to interference factors related to the target scene; The foreground image and / or the background image are combined with the picture training data to obtain the picture training data containing interference factors related to the target scene.
9. The method according to claim 3, after constructing picture training data containing interference factors related to the target scene and / or target language according to the target language sentence, the method further comprises: Generate handwritten target language sentences according to the target language sentences in the image training data; According to the handwritten target language sentence, image training data including interference factors related to the target scene and / or target language is constructed.
10. According to the method of claim 3, the initial model includes a neural network model based on a CRNN framework.
11. The method according to claim 1, wherein the target scenario comprises at least one of the following: an online identity information verification scenario, a content translation scenario of a product details page on a shopping website, and a text data extraction scenario in a photo.
12. According to the method of claim 11, when the target scene includes an online identity information verification scene, the target image includes a user's ID card photo, and the acquired text data includes user identity information data.
13. The method according to claim 12, after acquiring the text data of the target language in the target image, the method further comprises: The user's identity is authenticated by comparing the text data with the user data stored in the corresponding user database.
14. A method for training a target language processing model, comprising: Generating target language sentences; wherein the target language is a minority language with a small number of speakers and a limited area of use; the target language sentences include: sentences with complete syntactic structures, and sentences or phrases with incomplete syntactic structures that allow partial omissions in spoken language but do not affect the overall semantics; According to the target language sentence, construct image training data that at least includes interference factors related to the target language; wherein the interference factors related to the language include: character marks below the target language characters in the target language sentence in the adjacent upper line, and / or, character marks above the target language characters in the target language sentence in the adjacent lower line; the character marks include: tone marks, character marks of vowels, and character marks of consonants; Using the image training data to train an initial model to obtain a preset target language processing model; The target language sentence is generated in the following manner: Determine a starting target language character; call a preset target language sentence generation model to predict a connecting target language character and an ending target language character according to the starting target language character; concatenate the starting target language character, the connecting target language character, and the ending target language character to obtain the target language sentence; wherein the preset target language sentence generation model is a model that is obtained by training and learning in advance using historical text data related to the target scenario and using the target language, and can predict the connection probability between different target language characters in a sentence; And, obtaining a corpus of text data in the target language; retrieving sentences or phrases in text form related to the target scenario from the corpus of text data in the target language as the target language sentences.
15. The method according to claim 14, wherein generating a target language sentence comprises: Determine the starting target language characters; Calling a preset target language sentence generation model to predict the connecting target language character and the ending target language character according to the starting target language character; wherein the preset target language sentence generation model is used to predict the next target language character connected to the input target language character in the sentence; The target language sentence is obtained by concatenating the starting target language characters, the connecting target language characters, and the ending target language characters.
16. The method according to claim 14, constructing picture training data containing interference factors related to the target language according to the target language sentence, comprising: Arrange multiple target language sentences in vertical direction; Calling a preset rendering tool to generate a first image including a plurality of target language sentences arranged in a vertical direction; According to a preset clipping rule, screenshots each containing a line of target language sentences in the multiple lines of target language sentences arranged in the vertical direction are clipped from the first image as image training data containing interference factors related to the target language; wherein the screenshot contains character marks below the target language characters in the target language sentence in the previous line adjacent to the target language sentence in the current line corresponding to the screenshot, and / or character marks above the target language characters in the target language sentence in the next line adjacent to the target language sentence in the current line corresponding to the screenshot.
17. A method for generating image training data, comprising: Generating target language sentences; wherein the target language is a minority language with a small number of speakers and a limited area of use; the target language sentences include: sentences with complete syntactic structures, and sentences or phrases with incomplete syntactic structures that allow partial omissions in spoken language but do not affect the overall semantics; According to the target language sentence, constructing picture training data that at least includes interference factors related to the target language; The language-related interference factors include: character marks below the target language characters in the target language sentence in the adjacent upper line, and / or character marks above the target language characters in the target language sentence in the adjacent lower line; the character marks include: tone marks, character marks of vowels, and character marks of consonants; the image training data is used to train a preset target language processing model; The target language sentence is generated in the following manner: Determine a starting target language character; call a preset target language sentence generation model to predict a connecting target language character and an ending target language character according to the starting target language character; concatenate the starting target language character, the connecting target language character, and the ending target language character to obtain the target language sentence; wherein the preset target language sentence generation model is a model that is obtained by training and learning in advance using historical text data related to the target scenario and using the target language, and can predict the connection probability between different target language characters in a sentence; And, obtaining a corpus of text data in the target language; retrieving sentences or phrases in text form related to the target scenario from the corpus of text data in the target language as the target language sentences.
18. A device for recognizing text data in a target language, comprising: An acquisition module, used to acquire a target image containing text data in a target language in a target scene; wherein the target language is a minority language with a small number of users and a limited area of use; A processing module, configured to call a preset target language processing model to process the target image to obtain text data of the target language in the target image; wherein the preset target language processing model includes a model pre-trained using the constructed image training data at least containing interference factors related to the target language; The language-related interference factors include: character marks below the target language characters in the target language sentence in the adjacent upper line, and / or character marks above the target language characters in the target language sentence in the adjacent lower line; the character marks include: tone marks, character marks of vowels, and character marks of consonants; the target language sentences include: sentences with complete syntactic structures, and sentences or phrases with incomplete syntactic structures that allow partial structural omissions in spoken language but do not affect the overall semantics; The target language sentence is generated in the following manner: Determine a starting target language character; call a preset target language sentence generation model to predict a connecting target language character and an ending target language character according to the starting target language character; concatenate the starting target language character, the connecting target language character, and the ending target language character to obtain the target language sentence; wherein the preset target language sentence generation model is a model that is obtained by training and learning in advance using historical text data related to the target scenario and using the target language, and can predict the connection probability between different target language characters in a sentence; And, obtaining a corpus of text data in the target language; retrieving sentences or phrases in text form related to the target scenario from the corpus of text data in the target language as the target language sentences.
19. A server, comprising a processor and a memory for storing processor-executable instructions, wherein the processor implements the steps of the method according to any one of claims 1 to 13 when executing the instructions.
Citation Information
Patent Citations
Character recognition model generation method and device, equipment and medium
CN109753968A
Scene adaptation learning method and system based on pre-trained model
CN111783881A
Formula recognizing device and formula recognizing method
JP2003256769A