Text recognition method and device, readable medium, electronic equipment and program product

Through the combination of text recognition model and multimodal model, the text recognition results are corrected using prompt words, which solves the accuracy of text recognition models in the prior art in complex scenarios, and improves the accuracy and applicability of the recognition results.

CN119693958APending Publication Date: 2025-03-25DOUYIN VISION CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411826878.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-11
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

The existing text recognition model is not very accurate in complex scenarios and is prone to produce inaccurate text recognition results.

Method used

The target image is initially recognized through the text recognition model, the prompt word is constructed and the preset template is used to correct the preliminary recognition results based on the image and prompt word.

Benefits of technology

It improves the accuracy of text recognition results, reduces the difficulty of text recognition in multimodal models, and is suitable for different types of text recognition models and diversified scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119693958A_ABST
    Figure CN119693958A_ABST
Patent Text Reader

Abstract

A text recognition method and apparatus, a readable medium, an electronic device and a program product, the text recognition method comprising: determining a first text recognition result of a text recognition model for a target image, the text recognition model being used for recognizing text content in an input image; on the basis of the first text recognition result and a preset cue word template, constructing cue words, wherein the cue words are used for indicating a multi-modal model to correct the first text recognition result; and obtaining a second text recognition result after the first text recognition result is corrected through a multi-modal model based on the target image and the cue word. According to the method, the recognition result of the text recognition model can be used as priori knowledge, the text recognition difficulty of the multi-modal model is effectively reduced, the cross-modal understanding ability of the multi-modal model for the image and the text is utilized, the recognition result of the text recognition model is subjected to double correction based on the cue word and the target image, and the recognition accuracy is improved. Therefore, the accuracy of the text recognition result of the multi-modal model is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular, to a text recognition method, device, readable medium, electronic device, and program product. Background Art

[0002] The text recognition model is a deep neural network model for specific text recognition tasks, including note recognition models, computational recognition models, handwriting recognition models, text block recognition models, etc. It usually adopts a lightweight network architecture with a small parameter scale and specialized task-specific capabilities. Due to the limited parameter scale, the feature expression ability obtained by the text recognition model is limited. In complex scenarios, the accuracy of the text recognition model is not high, which is prone to inaccurate text recognition results. Summary of the invention

[0003] This summary is provided to introduce concepts in a brief form that will be described in detail in the detailed description below. This summary is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.

[0004] In a first aspect, the present disclosure provides a text recognition method, the text recognition method comprising: Determine a first text recognition result of a text recognition model for a target image, wherein the text recognition model is used to recognize text content in an input image; constructing a prompt word based on the first text recognition result and a preset prompt word template, wherein the prompt word is used to instruct the multimodal model to correct the first text recognition result; A second text recognition result is obtained by correcting the first text recognition result based on the target image and the prompt word through the multimodal model.

[0005] In a second aspect, the present disclosure provides a text recognition device, the text recognition device comprising: A determination module, used to determine a first text recognition result of a text recognition model for a target image, wherein the text recognition model is used to recognize text content in an input image; A construction module, configured to construct a prompt word based on the first text recognition result and a preset prompt word template, wherein the prompt word is used to instruct the multimodal model to correct the first text recognition result; A correction module is used to obtain a second text recognition result after correcting the first text recognition result based on the target image and the prompt word through the multimodal model.

[0006] In a third aspect, the present disclosure provides a computer-readable medium having a computer program stored thereon, which implements the steps of the method described in the first aspect when the program is executed by a processing device.

[0007] In a fourth aspect, the present disclosure provides an electronic device, including: a storage device having a computer program stored thereon; A processing device is used to execute the computer program in the storage device to implement the steps of the method in the first aspect.

[0008] In a fifth aspect, the present disclosure provides a computer program product, comprising a computer program, which implements the steps of the method described in the first aspect when executed by a processor.

[0009] Through the above technical solution, a prompt word can be constructed based on the first text recognition result of the target image and the preset prompt word template of the text recognition model, and then the first text recognition result can be corrected based on the target image and the prompt word through the multimodal model to obtain the corrected second text recognition result. Using this method, the recognition result of the text recognition model can be used as prior knowledge to effectively reduce the text recognition difficulty of the multimodal model, and the cross-modal understanding ability of the multimodal model for images and texts is utilized to double correct the recognition result of the text recognition model based on the prompt word and the target image, thereby improving the accuracy of the text recognition result of the multimodal model. In addition, it can connect different types of text recognition models to meet the diverse scenarios in practical applications.

[0010] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale. In the drawings: Figure 1 is a flowchart of a text recognition method according to an exemplary embodiment of the present disclosure; Figure 2 is a schematic diagram of a process of text correction using a multimodal model according to an exemplary embodiment of the present disclosure; Figure 3 is a schematic diagram of a feature splicing process according to an exemplary embodiment of the present disclosure; Figure 4 is a structural block diagram of a text recognition device according to an exemplary embodiment of the present disclosure; Figure 5It is a schematic structural diagram of an electronic device according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0012] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0013] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0014] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0015] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0016] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0017] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0018] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0019] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.

[0020] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0021] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0022] At the same time, it is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.

[0023] The text recognition model is also called the Optical Character Recognition (OCR) model. Due to the limited parameter scale, the feature expression ability of the text recognition model is limited. For example, the word recognition model based on CTC technology (Connectionist Temporal Classification) relies only on visual features in its recognition process, lacks contextual semantic understanding, and is prone to produce recognition results that do not conform to language rules. In addition, the accuracy of the text recognition model is not high in complex scenarios, and it is easy to produce inaccurate text recognition results. For example, if the picture includes text and calculation formulas, if the text is recognized by the word recognition model, the calculation formula part is easy to be recognized incorrectly, and if the calculation formula recognition model is used for recognition, the text part is easy to be recognized incorrectly.

[0024] In view of this, the present disclosure provides a text recognition method, device, readable medium, electronic device and program product to solve the above technical problems.

[0025] The embodiments of the present disclosure are further explained below with reference to the accompanying drawings.

[0026] Figure 1 is a flowchart of a text recognition method according to an exemplary embodiment of the present disclosure, referring to Figure 1 , the text recognition method may include the following steps: S101: Determine a first text recognition result of a text recognition model for a target image, where the text recognition model is used to recognize text content in an input image.

[0027] The text recognition model may be a note recognition model, a calculation recognition model, a handwriting recognition model, a text block recognition model, etc., and the present disclosure does not limit this. The text content includes text, characters, mathematical calculation formulas, etc. in different languages, which can be determined according to the needs, and the present disclosure does not limit this.

[0028] It should be noted that the target image can be acquired first, and then the target image can be input into the text recognition model to obtain the corresponding text recognition result. The target image and the text recognition result of the text recognition model for the target image can also be stored, and then the stored target image and the text recognition result corresponding to the target image can be directly acquired. The present disclosure does not impose any restrictions on this.

[0029] In a possible manner, the text recognition method further includes: acquiring an initial image to be recognized; performing image preprocessing on the initial image to obtain a target image, wherein the image preprocessing includes resolution unification and / or illumination normalization.

[0030] For example, the initial image to be recognized can be subjected to image preprocessing to obtain a target image, such as resolution unification, illumination normalization, etc., to provide standardized visual input for subsequent feature extraction of the target image, so as to correct recognition result errors caused by image quality problems such as blur, deformation, and uneven illumination, and provide more robust recognition result correction.

[0031] S102: Constructing a prompt word based on the first text recognition result and a preset prompt word template, where the prompt word is used to instruct the multimodal model to correct the first text recognition result.

[0032] For example, Figure 2 As shown, the recognition result of the text recognition model for the target image is "examp / e", and the prompt word constructed according to the preset prompt word template can be "Please correct the following recognition result based on the given image: examp / e", which can be determined according to the actual scenario, and the present disclosure does not limit this.

[0033] S103: Obtaining a second text recognition result after correcting the first text recognition result based on the target image and the prompt word through a multimodal model.

[0034] For example, Figure 2 As shown, the multimodal model's cross-modal understanding ability of images and texts is utilized to perform a doubly corrected text recognition result of the text recognition model based on the prompt words and the target image to obtain the corrected text recognition result.

[0035] By adopting the above method, the recognition results of the text recognition model can be used as prior knowledge, effectively reducing the difficulty of text recognition in the multimodal model, and using the cross-modal understanding ability of the multimodal model for images and texts, the recognition results of the text recognition model are double-corrected based on the prompt words and the target image, thereby improving the accuracy of the text recognition results of the multimodal model. In addition, different types of text recognition models can be connected to meet the diverse scenarios in practical applications.

[0036] It should be understood that if a text recognition model is used alone, it is easy to make recognition errors in complex scenarios. If a multimodal model is used alone to perform text recognition on images, it is difficult to train and use. The embodiment of the present disclosure can use the text recognition results of the text recognition model as prior knowledge, effectively reducing the difficulty of text recognition of the multimodal model, thereby improving the accuracy of text recognition.

[0037] In a possible manner, a second text recognition result that is a correction of the first text recognition result is obtained based on the target image and the prompt words through a multimodal model, including: determining a first feature sequence of the visual dimension based on the target image through a multimodal model, and determining a second feature sequence of the language dimension based on the prompt words, and correcting the first text recognition result based on the first feature sequence and the second feature sequence to obtain a second text recognition result.

[0038] For example, through the cross-modal understanding ability of the multimodal model, a first feature sequence of the visual dimension obtained based on the target image and a second feature sequence of the language dimension obtained based on the prompt word are used to achieve dual correction of the visual dimension and the language dimension, thereby improving the accuracy of the text recognition results.

[0039] In a possible manner, the multimodal model includes a visual feature encoding module, a word embedding layer and a large language model. The multimodal model determines a first feature sequence of a visual dimension based on a target image, and determines a second feature sequence of a language dimension based on a prompt word. The first text recognition result is corrected based on the first feature sequence and the second feature sequence to obtain a second text recognition result, including: determining the first feature sequence of a visual dimension based on the target image through the visual feature encoding module; determining the second feature sequence of a language dimension based on the prompt word through the word embedding layer; and correcting the first text recognition result based on the first feature sequence and the second feature sequence through the large language model to obtain a second text recognition result.

[0040] For example, Figure 2 As shown, the visual feature encoding module is used to extract image features of an image. The visual encoding feature module can be a convolutional neural network-based model, a deep neural network-based model, a Transformer-based model, etc. The specific model can be determined according to needs, and the present disclosure does not limit this.

[0041] For example, Figure 2 As shown, the prompt word is represented by a vector through a word embedding layer to obtain a word embedding vector corresponding to the prompt word, and the word embedding vector is used as a feature sequence corresponding to the prompt word. Using the word embedding vector as a feature representation of the prompt word can retain the semantic structure of the prompt word, so that the large language model can better understand the semantics of the prompt word. Of course, the feature sequence corresponding to the prompt word can also be extracted through a text feature encoding module similar to the visual feature encoding module, which can be determined according to needs, and the present disclosure does not limit this.

[0042] For example, Figure 2 As shown, the first text recognition result can be double-corrected by a large language model (LLM) based on the first feature sequence and the second feature sequence to improve the accuracy of the text recognition result. Of course, other machine learning models that can replace the large language model can also be used, which can be determined according to needs, and the present disclosure does not limit this.

[0043] In a possible manner, a first feature sequence of a visual dimension is determined based on a target image through a visual feature encoding module, including: performing feature extraction on a text area in the target image through a visual feature encoding module to obtain image visual features of the target image, and performing feature extraction on a surrounding area of ​​the text area in the target image to obtain image context features of the target image; and determining a first feature sequence based on the image visual features and the image context features.

[0044] For example, for an image that includes text content, the image visual features may be features extracted from pixels in the text area of ​​the image, and the image context features may be features extracted from pixels around the text area of ​​the image. Based on the image visual features and image context features, a high-dimensional visual feature sequence may be obtained, which contains key visual information and image context information in the image. Thus, through the visual feature encoding module, the image features of the target image can be fully extracted, so that the powerful visual understanding ability of the multimodal model can be used to perform visual corrections on the text recognition results of the text recognition model, and through in-depth analysis of the image context information, the recognition result errors caused by insufficient visual feature extraction can be identified and corrected.

[0045] In a possible manner, a first text recognition result is corrected based on a first feature sequence and a second feature sequence through a large language model to obtain a second text recognition result, including: concatenating the first feature sequence and the second feature sequence to obtain a multimodal feature, and inputting the multimodal feature into the large language model; performing feature fusion and feature interaction on the first feature sequence and the second feature sequence in the multimodal feature based on a multi-layer attention mechanism through the large language model to correct the first text recognition result in visual and language dimensions to obtain a second text recognition result.

[0046] For example, Figure 3 As shown, the feature concatenation operation of the first feature sequence and the second feature sequence is performed in the sequence dimension, and the concatenated multimodal features are input into the large language model. The large language model includes multiple attention layers. Through the multi-layer attention mechanism, the large language model can realize cross-modal feature fusion and feature interaction for visual features and text features, perform comprehensive semantic understanding and analysis, improve the generalization ability of the large language model, and generate high-confidence text recognition results.

[0047] Among them, feature fusion focuses on combining multimodal features to achieve a more comprehensive feature representation, while feature interaction focuses on the relationship and interaction between features of different modalities. Feature fusion and feature interaction can effectively improve the prediction performance and generalization ability of large language models.

[0048] In a possible manner, the first text recognition result is corrected in visual and language dimensions to obtain a second text recognition result, including: performing semantic analysis and / or contextual reasoning on multimodal features to correct the language and / or language rules of the first text recognition result to obtain a second text recognition result.

[0049] It should be understood that a well-trained large language model has strong semantic understanding and contextual reasoning capabilities. Therefore, by performing semantic analysis on multimodal features, the text recognition results of the text recognition model can be optimized at the language level, and model reasoning using contextual information can provide more accurate text correction suggestions, where language-level corrections can be corrections of typos, semantic errors, etc. In addition, recognition errors that do not conform to language rules, such as spelling errors, grammatical errors, etc., can also be corrected based on semantic analysis and / or contextual reasoning.

[0050] For example, assuming that the text in the image to be recognized is "example place, xxxx; example place, xxxx;", the recognition result of the text recognition model is "example place, xxxx; example place, xxxx;", based on semantic analysis or context analysis, it can be determined that the text content is a text that lists different examples, so the second "example place" is corrected to "example place", and the correction of language rules is also based on the same logic, such as Figure 2 The spelling errors shown are not further described in this disclosure.

[0051] Using the above method, the recognition results of the target image and text recognition model are input into the multimodal model. Through the cross-modal understanding ability of the multimodal model, dual correction based on visual features and language knowledge is achieved. On the one hand, the image visual features and image context features are used for visual correction. On the other hand, the semantic understanding ability and contextual reasoning ability of the large language model are combined to make full use of language knowledge as prior knowledge to correct recognition errors that do not conform to language rules, ensuring the accuracy and semantic rationality of the text recognition results output by the multimodal model. It can also connect to different types of text recognition models to meet the diverse scenarios in practical applications.

[0052] It should be understood that in the training process of the above-mentioned multimodal model, sample images can be constructed to train the visual feature encoding module, sample prompt words can be constructed to train the word embedding layer or the text feature encoding module, and sample images and corresponding sample prompt words can be constructed to train the large language model. Sample images and corresponding sample prompt words can also be constructed to train the multimodal model as a whole. The specific details can be determined according to needs, and the present disclosure does not limit this.

[0053] In other possible implementations, the recognition results of the audio recognition model can also be corrected based on the multimodal model, for example, the text recognition results of the audio data to be recognized by the audio recognition model are obtained, prompt words are constructed based on the text recognition results, and then the text recognition results of the audio recognition model are corrected based on the prompt words and the audio data to be recognized by the multimodal model to obtain the corrected text recognition results. The specifics can be determined according to the needs, and the present disclosure does not limit this.

[0054] Based on the same concept, the present disclosure provides a text recognition device, such as Figure 4 As shown, the text recognition device 400 includes: A determination module 401 is used to determine a first text recognition result of a text recognition model for a target image, wherein the text recognition model is used to recognize text content in an input image; A construction module 402 is used to construct a prompt word based on the first text recognition result and a preset prompt word template, wherein the prompt word is used to instruct the multimodal model to correct the first text recognition result; The correction module 403 is used to obtain a second text recognition result after correcting the first text recognition result based on the target image and the prompt word through the multimodal model.

[0055] By using the above device, the recognition results of the text recognition model can be used as prior knowledge, effectively reducing the difficulty of text recognition in the multimodal model, and using the cross-modal understanding ability of the multimodal model for images and texts, the recognition results of the text recognition model are double-corrected based on the prompt words and the target image, thereby improving the accuracy of the text recognition results of the multimodal model. In addition, different types of text recognition models can be connected to meet the diverse scenarios in practical applications.

[0056] Optionally, the correction module 403 is used to: The multimodal model determines a first feature sequence of a visual dimension based on the target image, and determines a second feature sequence of a language dimension based on the prompt word. The first text recognition result is corrected based on the first feature sequence and the second feature sequence to obtain the second text recognition result.

[0057] Optionally, the multimodal model includes a visual feature encoding module, a word embedding layer and a large language model, and the correction module 403 includes: A first determination submodule, configured to determine a first feature sequence of a visual dimension based on the target image through the visual feature encoding module; A second determination submodule, configured to determine a second feature sequence of a language dimension based on the prompt word through the word embedding layer; A correction submodule is used to correct the first text recognition result based on the first feature sequence and the second feature sequence through the large language model to obtain the second text recognition result.

[0058] Optionally, the first determining submodule is used for: Extracting features of the text area in the target image by the visual feature encoding module to obtain image visual features of the target image, and extracting features of the surrounding area of ​​the text area in the target image to obtain image context features of the target image; The first feature sequence is determined based on the image visual features and the image context features.

[0059] Optionally, the correction submodule is used to: Concatenate the first feature sequence and the second feature sequence to obtain a multimodal feature, and input the multimodal feature into the large language model; The large language model performs feature fusion and feature interaction on the first feature sequence and the second feature sequence in the multimodal features based on a multi-layer attention mechanism, so as to correct the first text recognition result in visual and language dimensions, thereby obtaining the second text recognition result.

[0060] Optionally, the correction submodule is used to: Perform semantic analysis and / or contextual reasoning on the multimodal features to correct the language and / or language regularity of the first text recognition result to obtain the second text recognition result.

[0061] Optionally, the text recognition device 400 further includes a preprocessing module, and the preprocessing module is used to: Obtaining an initial image to be recognized; The initial image is subjected to image preprocessing to obtain the target image, wherein the image preprocessing includes resolution unification and / or illumination normalization.

[0062] Based on the same concept, an embodiment of the present disclosure further provides a computer-readable medium on which a computer program is stored, and when the program is executed by a processing device, the steps of the above-mentioned text recognition method are implemented.

[0063] Based on the same concept, the present disclosure also provides an electronic device, which may include: a storage device having a computer program stored thereon; The processing device is used to execute the computer program in the storage device to implement the steps of the above-mentioned text recognition method.

[0064] Based on the same concept, an embodiment of the present disclosure further provides a computer program product, including a computer program, which implements the steps of the above-mentioned text recognition method when executed by a processor.

[0065] Reference below Figure 5 , which shows a schematic diagram of the structure of an electronic device 500 suitable for implementing the embodiment of the present disclosure. The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0066] like Figure 5As shown, the electronic device 500 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 to a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0067] Typically, the following devices may be connected to the I / O interface 505: an input device 506 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 508 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 509. The communication device 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 5 The electronic device 500 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0068] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 509, or installed from a storage device 508, or installed from a ROM 502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0069] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than computer readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0070] In some embodiments, any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol) can be used for communication, and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0071] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0072] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: determines a first text recognition result of a text recognition model for a target image, wherein the text recognition model is used to recognize text content in an input image; constructs a prompt word based on the first text recognition result and a preset prompt word template, wherein the prompt word is used to instruct a multimodal model to correct the first text recognition result; and obtains a second text recognition result after correcting the first text recognition result based on the target image and the prompt word through the multimodal model.

[0073] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0074] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0075] The modules involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a module does not, in some cases, limit the module itself.

[0076] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0077] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0078] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0079] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0080] Although the subject matter has been described in language specific to structural features and / or method logic actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims. Regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.

Claims

1. A text recognition method, characterized in that: The text recognition method comprises: Determine a first text recognition result of a text recognition model for a target image, wherein the text recognition model is used to recognize text content in an input image; constructing a prompt word based on the first text recognition result and a preset prompt word template, wherein the prompt word is used to instruct the multimodal model to correct the first text recognition result; A second text recognition result is obtained by correcting the first text recognition result based on the target image and the prompt word through the multimodal model.

2. The text recognition method according to claim 1, characterized in that: The obtaining, based on the target image and the prompt word, a second text recognition result after correcting the first text recognition result through the multimodal model includes: The multimodal model determines a first feature sequence of a visual dimension based on the target image, and determines a second feature sequence of a language dimension based on the prompt word. The first text recognition result is corrected based on the first feature sequence and the second feature sequence to obtain the second text recognition result.

3. The text recognition method according to claim 2, characterized in that: The multimodal model includes a visual feature encoding module, a word embedding layer and a large language model. The multimodal model is used to determine a first feature sequence of a visual dimension based on the target image, and a second feature sequence of a language dimension based on the prompt word. The first text recognition result is corrected based on the first feature sequence and the second feature sequence to obtain the second text recognition result, including: Determining a first feature sequence of a visual dimension based on the target image by the visual feature encoding module; Determine a second feature sequence of the language dimension based on the prompt word through the word embedding layer; The first text recognition result is corrected by the large language model based on the first feature sequence and the second feature sequence to obtain the second text recognition result.

4. The text recognition method according to claim 3, characterized in that: The determining, by the visual feature encoding module, a first feature sequence of a visual dimension based on the target image comprises: Extracting features of the text area in the target image by the visual feature encoding module to obtain image visual features of the target image, and extracting features of the surrounding area of ​​the text area in the target image to obtain image context features of the target image; The first feature sequence is determined based on the image visual features and the image context features.

5. The text recognition method according to claim 3, characterized in that: The correcting the first text recognition result based on the first feature sequence and the second feature sequence by the large language model to obtain the second text recognition result includes: Concatenate the first feature sequence and the second feature sequence to obtain a multimodal feature, and input the multimodal feature into the large language model; The large language model performs feature fusion and feature interaction on the first feature sequence and the second feature sequence in the multimodal features based on a multi-layer attention mechanism, so as to correct the first text recognition result in visual and language dimensions, thereby obtaining the second text recognition result.

6. The text recognition method according to claim 5, characterized in that: The correcting the first text recognition result in visual dimension and language dimension to obtain the second text recognition result includes: Perform semantic analysis and / or contextual reasoning on the multimodal features to correct the language and / or language regularity of the first text recognition result to obtain the second text recognition result.

7. The text recognition method according to any one of claims 1 to 6, characterized in that: The text recognition method further comprises: Obtaining an initial image to be recognized; The initial image is subjected to image preprocessing to obtain the target image, wherein the image preprocessing includes resolution unification and / or illumination normalization.

8. A text recognition device, characterized in that: The text recognition device comprises: A determination module, used to determine a first text recognition result of a text recognition model for a target image, wherein the text recognition model is used to recognize text content in an input image; A construction module, configured to construct a prompt word based on the first text recognition result and a preset prompt word template, wherein the prompt word is used to instruct the multimodal model to correct the first text recognition result; A correction module is used to obtain a second text recognition result after correcting the first text recognition result based on the target image and the prompt word through the multimodal model.

9. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processing device, the steps of the method according to any one of claims 1 to 7 are implemented.

10. An electronic device, characterized in that: include: a storage device having a computer program stored thereon; A processing device, configured to execute the computer program in the storage device to implement the steps of the method according to any one of claims 1 to 7.

11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Text recognition method and device and computing equipment

    CN121214457A

  • Construction engineering drawing structured information extraction method and device, equipment and medium

    CN122157299A

  • Building engineering drawing structured information extraction method, device, equipment and medium

    CN122157299B