Document processing method and device, equipment and storage medium
By receiving and merging the recognized text of multiple image data units, the limitation of single image processing in the existing technology is solved, the automatic merging and editing of multi-image text is realized, and the convenience and efficiency of document processing are improved.
Patent Information
- Application Number
- CN202410804849.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-20
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2044-06-20
AI Technical Summary
Existing image recognition technology can only process text in a single image, and cannot integrate and edit text content in multiple images. The parsing and extraction efficiency of images in specific formats is low, and it is difficult to adjust independently to adapt to different application scenarios.
By receiving multiple image data units, the recognized text corresponding to each image is obtained, merged into target text according to the order of addition, and added to the full text unit of the target document. It provides the functions of image addition and text merging, and supports multi-image text recognition and edit.
It realizes the automatic merging and editing of multiple image texts, simplifies the text processing process, reduces the difficulty of user skills and development, and improves the convenience and efficiency of document processing.
Smart Images

Figure CN118658173A
Abstract
Description
Technical Field
[0001] Example embodiments of the present disclosure generally relate to the field of computers, and more particularly, to methods, devices, apparatuses, and computer-readable storage media for document processing. Background Art
[0002] In many usage scenarios, the text content in the image needs to be edited or stored. To this end, the text in the image can be recognized by image recognition technology such as optical character recognition (OCR). OCR refers to the process of analyzing an image to obtain text information in the image. For example, by scanning a form or a receipt, an image of the scanned form or receipt can be obtained. It is usually impossible to edit, search or count the text in such an image. In this case, OCR can be used to convert the image into text. However, there are still many inconveniences in the scenario of converting images into text using OCR. Summary of the invention
[0003] In a first aspect of the present disclosure, a method for document processing is provided. The method includes: receiving an operation of adding at least one first image to an image data unit in a target document; obtaining at least one first recognition text corresponding to the at least one first image, each first recognition text being obtained by text recognition of the corresponding first image; merging the at least one first recognition text into a target text according to the order in which the at least one first image is added; and adding the target text to a full text unit corresponding to the image data unit in the target document.
[0004] In a second aspect of the present disclosure, a device for document processing is provided. The device includes: a receiving module configured to receive an operation of adding at least one first image to an image data unit in a target document; an acquisition module configured to acquire at least one first recognition text corresponding to the at least one first image, each first recognition text being obtained by text recognition of the corresponding first image; a merging module configured to merge the at least one first recognition text into a target text according to the order in which the at least one first image is added; and an adding module configured to add the target text to a full text unit corresponding to the image data unit in the target document.
[0005] In a third aspect of the present disclosure, an electronic device is provided. The device includes at least one processing unit; and at least one memory, the at least one memory is coupled to the at least one processing unit and stores instructions for execution by the at least one processing unit. When the instructions are executed by the at least one processing unit, the electronic device executes the method of the first aspect.
[0006] In a fourth aspect of the present disclosure, a computer-readable storage medium is provided, wherein a computer program is stored on the medium, and when the computer program is executed by a processor, the method of the first aspect is implemented.
[0007] In a fifth aspect of the present disclosure, a computer program product is provided, which includes a computer program, wherein when the computer program is executed by a processor, the method according to the first aspect of the present disclosure is implemented.
[0008] It should be understood that the content described in this section is not intended to limit the key features or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] 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. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, wherein:
[0010] Figure 1 A schematic diagram showing an example environment in which embodiments of the present disclosure can be implemented;
[0011] Figures 2A to 2G Schematic diagrams showing examples of editing pages according to some embodiments of the present disclosure;
[0012] Figure 3 A flowchart showing a process for document processing according to some embodiments of the present disclosure is shown;
[0013] Figure 4 An exemplary structural block diagram of an apparatus for document processing according to some embodiments of the present disclosure is shown; and
[0014] Figure 5 A block diagram of an electronic device in which one or more embodiments of the present disclosure may be implemented is shown. DETAILED DESCRIPTION
[0015] 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 set forth herein. On the contrary, these embodiments are provided to provide 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.
[0016] In the description of the embodiments of the present disclosure, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The term "some embodiments" should be understood as "at least some embodiments". Other explicit and implicit definitions may also be included below.
[0017] Herein, unless explicitly stated, executing a step “in response to A” does not mean executing the step immediately after “A” but may include one or more intermediate steps.
[0018] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition, use, storage or deletion of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.
[0019] It is understandable that before using the technical solutions disclosed in the various embodiments of the present disclosure, the types, scopes of use, usage scenarios, etc. of the information involved in the present disclosure should be informed to relevant users and their authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations. The relevant users may include any type of right holders, such as individuals, enterprises, and groups.
[0020] For example, in response to receiving an active request from a user, a prompt message is sent to the relevant user to clearly prompt the relevant user that the operation requested to be performed will require obtaining and using the information of the relevant user, so that the relevant user can independently choose whether to provide information to software or hardware such as an electronic device, application, server or storage medium that executes the operation of the technical solution of the present disclosure based on the prompt message.
[0021] As an optional but non-limiting implementation, in response to receiving an active request from a relevant user, a prompt message is sent to the relevant user, for example, in the form of a pop-up window, in which the prompt message may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to select "agree" or "disagree" to provide information to the electronic device.
[0022] 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 relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0023] As used herein, the term "model" can learn the association between the corresponding input and output from the training data, so that after the training is completed, the corresponding output can be generated for a given input. The generation of the model can be based on machine learning technology. Deep learning is a machine learning algorithm that processes inputs and provides corresponding outputs by using multi-layer processing units. A neural network model is an example of a model based on deep learning. In this article, "model" may also be referred to as "machine learning model", "learning model", "machine learning network" or "learning network", and these terms are used interchangeably in this article.
[0024] As discussed above, in the image text recognition scenario, the text in the image can be recognized through image recognition technology. However, conventional image recognition technology only allows users to upload one image at a time and generates text corresponding to the image uploaded this time, but cannot integrate the text content in multiple images. In addition, conventional image recognition technology can usually only accurately parse and extract images in a specific format, and is usually only targeted at specific application scenarios. When developing a new scenario, a lot of development work is required. This is very difficult for users without relevant skills, and it is usually difficult to achieve self-adjustment.
[0025] In view of this, in an embodiment of the present disclosure, an improved solution for document processing is provided. According to the solution of the embodiment of the present disclosure, if a user adds at least one image to an image data unit in a target document, at least one recognition text corresponding to the at least one image is obtained, and each recognition text is obtained by text recognition of the corresponding image. According to the order in which at least one image is added, the at least one recognition text is merged into the target text, and the target text is added to the full text unit corresponding to the image data unit in the target document.
[0026] In this way, the text recognized in different images can be automatically merged together and added to the data unit of the target document. This eliminates the limitation on the number of images to be recognized and provides a convenient solution for text recognition and text editing of multiple images.
[0027] Example Environment
[0028] Figure 1 A schematic diagram of an example environment 100 in which embodiments of the present disclosure can be implemented is shown. In the example environment 100, one or more applications 130-1, 130-2, ..., 130-N are installed in a terminal device 120. For ease of discussion, the applications 130-1, 130-2, ..., 130-N may be collectively or individually referred to as applications 130. A user 140 may interact with the applications 130 via the terminal device 120 and / or an attached device of the terminal device 120.
[0029] In some embodiments, the terminal device 120 may include an image acquisition component (e.g., a camera). The terminal device 120 may capture the image 110 through the image acquisition component. In some embodiments, the terminal device 120 may also receive the image 110 sent by other electronic devices, or obtain the image 110 stored in itself. The image 110 may include a text sequence, and the text sequence may include text units in any font and any language.
[0030] In some embodiments, the application 130 can be downloaded and installed on the terminal device 120. In some embodiments, the application 130 can also be accessed through other means, such as through a web page. Figure 1 In the environment 100 , in response to the application 130 being started, the terminal device 120 may present a page 150 of the application 130 .
[0031] Applications 130 include, but are not limited to, one or more of the following: chat applications (also known as instant messaging applications), document applications, audio and video conferencing applications, email applications, task applications, calendar applications, objectives and key results (OKR) applications, etc. Figure 1 A single application is shown in the figure, but in fact, multiple applications can be installed on the terminal device 120. In some embodiments, the application 130 may include a multi-functional collaboration platform, such as an office collaboration platform (also called an office suite). Such a multi-functional collaboration platform can provide integration of various types of applications or components to facilitate people to carry out office, communication and other activities. In the multi-functional collaboration platform, people can start different applications or components as needed to complete the processing, sharing, communication, etc. of the corresponding content entity.
[0032] Application 130 may provide content entity 135. Content entity 135 may be a content instance created by user 140 or other users on application 130. For example, depending on the type of application 130, content entity 135 may be a document (e.g., a word document, a pdf document, a presentation, a spreadsheet document, etc.), an email, a message (e.g., a conversation message on an instant messaging application), a calendar, a schedule, a task, a project entity, an audio, a video, an image, etc.
[0033] In some embodiments, the environment 100 may include a text recognition model 160. The text recognition model 160 may perform text recognition on the image 110 to obtain the text contained in the image 110. The text recognition model 160 may be deployed on the main body of the terminal device 120, or may be deployed at a remote device. Alternatively or additionally, the text recognition model 160 may be a model based on OCR technology, or the text recognition model 160 may be a machine learning model based on deep learning technology. It is understandable that the text recognition model 160 may also be a machine learning model or a non-machine learning model built based on other technologies. The type of the text recognition model 160 is not limited here, as long as the function of recognizing text from the image 110 can be realized.
[0034] In some embodiments, the environment 100 may include a target model 180. The target model 180 may include any appropriate machine learning model. The target model 180 may be deployed on the side of the terminal device 120, may be deployed on the side of the server 170, or may be deployed at an appropriate remote device. In some embodiments, one or more target models 180 may be constructed based on a language model (LM). The target model used may be a content generation model that can generate corresponding outputs based on model inputs. In some embodiments, a machine learning model based on a language model can input a model in a textual mode (e.g., natural language and / or machine language) and / or a model in a non-textual mode (e.g., image, voice, video, etc.), and can generate a desired output based on the model input and a prompt word. The prompt word here is used to guide the machine learning model to generate user needs that can solve the model input.
[0035] In some embodiments, the terminal device 120 communicates with the server 170 to provide the service of the application 130. The terminal device 120 can be any type of mobile terminal, fixed terminal or portable terminal, including mobile phones, desktop computers, laptop computers, notebook computers, netbook computers, tablet computers, media computers, multimedia tablets, personal communication systems (PCS) devices, personal navigation devices, personal digital assistants (PDAs), audio / video players, digital cameras / camcorders, television receivers, radio broadcast receivers, e-book devices, gaming devices, or any combination of the foregoing, including accessories and peripherals of these devices or any combination thereof. In some embodiments, the terminal device 120 can also support any type of interface for the user (such as "wearable" circuits, etc.). The server 170 can be various types of computing systems / servers that can provide computing power, including but not limited to mainframes, edge computing nodes, computing devices in cloud environments, and the like.
[0036] It should be understood that the structure and function of the various elements in the environment 100 are described for exemplary purposes only and do not imply any limitation on the scope of the present disclosure.
[0037] Example Interaction
[0038] Some example embodiments of the present disclosure will be described below with continued reference to the accompanying drawings.
[0039] Figures 2A to 2G Schematic diagrams of example pages 200A to 200G (also referred to as examples 200A to 200G) according to some embodiments of the present disclosure are shown. It should be understood that the pages shown in the drawings are merely examples, and various page designs may actually exist. The various graphical elements in the pages may have different arrangements and different visual representations, one or more of which may be omitted or replaced, and one or more other elements may also exist. The embodiments of the present disclosure are not limited in this respect.
[0040] The pages shown in Examples 200A to 200G may be presented at the terminal device 120. For ease of discussion, reference will be made to Figure 1 Examples 200A to 200G are described based on the environment 100. It should be noted that the operations performed by the terminal device 120 described above and the operations performed by the terminal device 120 described later may be performed by related applications (such as application 130) installed on the terminal device 120. In some embodiments, the operations performed on the terminal device 120 may be completed with the assistance of the server 170.
[0041] In an embodiment of the present disclosure, the terminal device 120 receives an operation of adding at least one first image to an image data unit in a target document. The target document here includes but is not limited to a Word document, a PDF document, a presentation, a table document, and the like. The image data unit here can be any field or any data item in the target document. For example, when the target document is a table document, the image data unit can be any cell in the table document. The at least one first image may include one or more images, and the at least one first image may contain a text sequence. Of course, the at least one first image may not contain a text sequence, and the terminal device 120 may present a prompt message in response to not extracting text from the at least one first image. In the case of adding multiple images, these images may be added in batches at one time, or added gradually.
[0042] In some embodiments, the terminal device 120 may present the target document on an editing page in response to an edit request for the target document, and the editing page may include an image adding control. The terminal device 120 may add at least one first image to the image data unit through the image adding control in response to receiving a trigger operation on the image adding control. The editing page here is not limited to including image adding controls, but may also include but is not limited to document editing controls, document saving controls, text adding controls, text deleting controls, and the like. It is understandable that the types of controls included in the editing page may vary depending on the type of the target document, and may also vary depending on the functions of the application 130, and may be selected according to actual needs.
[0043] For example, Figure 2A As shown, example 200A shows an example of an edit page. Example 200A shows an edit page of a table (that is, in this example, the target document is a table). Example A includes a table header row 201 (e.g., attachment, full text, incremental text, field 3, field 4, etc.), an image data unit (e.g., cell 202a), and image adding controls (e.g., attachment adding control 203 and attachment adding control 204). Here, the image adding control can be presented in the image data unit in response to the selection operation of the image data unit. For example, Figure 2A As shown, when cell 202a is selected, terminal device 120 presents attachment adding control 203 and attachment adding control 204 in cell 202a. It can be understood that attachment adding control 203 and attachment adding control 204 can also be presented in other areas of the editing page, or each cell can display attachment adding control 203 and attachment adding control 204 respectively.
[0044] There are multiple implementations for adding at least one first image to the image data unit by the terminal device 120. In one example, the terminal device 120 can add the image to the cell 202 in a manner corresponding to the attachment adding control 202 or the attachment adding control 203 in response to a triggering operation of the attachment adding control 202 or the attachment adding control 203.
[0045] In another example, the terminal device 120 may present an attachment adding pop-up window 205 on the editing page in response to the triggering operation of the attachment adding control 202 or the attachment adding control 203, such as Figure 2BAs shown, the attachment adding pop-up window 205 may present an attachment adding control 206 and an attachment adding control 207. The terminal device 120 may add the image 208a and the image 208b to the cell 201a in response to dragging the icon of the image 208a and the image 208b to the area of the attachment adding control 206. The terminal device 120 may also add the image 208a and the image 208b to the cell 201a in response to the paste operation for the image 208a and the image 208b in the area of the attachment adding control 206. The terminal device 120 may also present a file selection window in response to the triggering operation of the attachment adding control 207. The terminal device 120 may add the image 208a and the image 208b to the cell 201a in response to selecting the image 208a and the image 208b through the file selection window.
[0046] In yet another example, the terminal device 120 may further add the image 208 a and the image 208 b to the cell 201 a in response to dragging the image icons of the image 208 a and the image 208 b into the area of the cell 201 a .
[0047] In some embodiments, when at least one first image has been added to the image data unit, the terminal device 120 may present the at least one first image or a thumbnail of the at least one first image in the image data unit. Figure 2C As shown, in the case where the image 208a and the image 208b have been added to the cell 202a, thumbnails of the image 208a and the image 208b may be displayed in the cell 202a.
[0048] In an embodiment of the present disclosure, the terminal device 120 obtains at least one first recognition text corresponding to at least one first image, and each first recognition text is obtained by text recognition of the corresponding first image.
[0049] In some embodiments, the terminal device 120 may provide at least one first image to the text recognition model 160 to perform text recognition on the at least one first image using the text recognition model 160. The terminal device 120 may receive at least one first recognized text fed back by the text recognition model 160. Exemplarily, in response to the image 208a and the image 208b being added to the cell 202a, the terminal device 120 may provide the image 208a and the image 208b to the text recognition model 160, perform text recognition on the image 208a and the image 208b using the text recognition model 160, and receive the text 209a (for example, which may include the characters "XXXXXX number: 12345") and 209b (for example, which may include the characters "YYYYYYYYYY") fed back by the text recognition model 160.
[0050] Alternatively or additionally, the terminal device 120 may provide the at least one first image to the text recognition model 160 in the order of addition, and sequentially obtain at least one first recognized text fed back by the text recognition model 160. For example, the terminal device 120 first adds the image 208a to the cell 202a, and then adds the image 208b to the cell 202a. The terminal device 120 may provide the image 208a to the text recognition model 160, and receive the text 209a fed back by the text recognition model 160. Afterwards, the terminal device 120 may provide the image 208b to the text recognition model 160, and receive the text 209b fed back by the text recognition model 160. Of course, the terminal device 120 may also provide the at least one first image to the text recognition model 160 in other orders or synchronously, and the order and manner in which the terminal device 120 provides the first image to the text recognition model 160 are not limited here.
[0051] In an embodiment of the present disclosure, the terminal device 120 may merge at least one first recognized text into a target text according to the order in which the at least one first image is added. Exemplarily, the terminal device 120 may receive text 209a and text 209b fed back sequentially by the text recognition model 160 in the order in which they are added. The terminal device 120 may merge text 209a and text 209b into text 209c (for example, including the characters "XXXXXX number: 12345YYYYYYYYYY").
[0052] In an embodiment of the present disclosure, the terminal device 120 may add the target text to the full text unit corresponding to the image data unit in the target document. Figure 2C As shown, cell 202a is an example of an image data unit, and cell 202b is an example of a full text unit corresponding to cell 202a. Terminal device 120 may add text 209c formed by merging text 209a and text 209b to cell 202b.
[0053] It should be understood that the full text unit can be any data unit in the target document that has a corresponding relationship with the image data unit. Figure 2C As shown, the cells in the column corresponding to the title "Attachment" in the table can be determined as image data cells, and the cells in the column corresponding to the title "Field 1" in the table can be determined as full text cells. The image data cells and full text cells in the same row correspond to each other. In this way, when cell 202a is an image data cell, cell 202b is the full text cell corresponding to cell 202a. For another example, Figure 2CThe cells in the first row of the table shown in the figure are determined as image data units, the cells in the second row of the table are determined as full text units, and it can be determined that the image data units and full text units in the same column have a corresponding relationship. Figure 2C The cell at the intersection of the first row and the first column in the table shown is determined as an image data unit, and the cell at the intersection of the second row and the second column can be determined as a corresponding full text unit.
[0054] Alternatively or additionally, the terminal device 120 may obtain a configuration instruction for the image data unit or a configuration instruction for the full text unit to determine the correspondence between the image data unit and the full text unit. Figure 2D As shown, the terminal device 120 may present an instruction input pop-up window 210 on the editing page in response to a selection operation on the "Field 1" title 201b. The instruction input pop-up window 210 may include an instruction input box 211, an instruction cancel control 212, and an instruction confirmation control 213. The user 140 may input a configuration instruction 214 to the instruction input box 211 through the terminal device 120 or an attached device of the terminal device 120. The terminal device 120 may determine the correspondence between the cells 202a and 202b based on the configuration instruction 214 in response to a trigger operation on the instruction confirmation control 213.
[0055] It is understandable that the user 140 also triggers the "Attachment" title 201a to cause the editing page to present an instruction input pop-up window similar to the instruction input pop-up window 210. The terminal device 120 can determine the correspondence between the cells 202a and 202b in response to the configuration instruction obtained through the instruction input pop-up window corresponding to the "Attachment" title 201a. In actual application, the correspondence between the image data unit and the full text unit can also be constructed in other ways.
[0056] In some embodiments, the terminal device 120 may add the first recognized text corresponding to the most recently added first image in the at least one first recognized text to the incremental text unit corresponding to the image data unit. Figure 2C As shown, if cell 202a is an image data unit, cell 202c is an incremental text unit corresponding to cell 202a, image 208b is the first image newly added to cell 202a, and text 209b is the text recognized from image 208, then text 209b can be added to cell 202c. In this way, it is helpful for user 140 to determine the text content recognized from the newly added first image.
[0057] It is understandable that the incremental text unit may be any data unit in the target document that has a corresponding relationship with the image data unit. Figure 2CAs shown, the cells in the column corresponding to the "Attachment" title (i.e., the first column) in the table can be determined as image data units, and the cells in the column corresponding to the "Field 2" title (i.e., the third column) can be determined as incremental text units, and it can be determined that the image data units and incremental text units located in the same row have a corresponding relationship. For example, Figure 2C The cells in the first row of the table shown are determined as image data units, the cells in the third row can be determined as incremental text units, and it can be determined that the image data units and incremental text units located in the same column have a corresponding relationship.
[0058] In some embodiments, the terminal device 120 may receive an operation of adding a second image to an image data unit, and add a second recognized text corresponding to the second image to the incremental text unit to replace the first recognized text in the incremental text unit. The second recognized text here is obtained by text recognition of the second image. The terminal device 120 may add the second recognized text to the full text unit to update the target text in the full text unit. That is, the text recognized in the newly added image and the existing text in the full text unit are merged into a new target text. Alternatively or additionally, the terminal device 120 may provide the second image to the text recognition model 160, perform text recognition on the second image using the text recognition model 160, and obtain the second recognized text corresponding to the second image (that is, the text contained in the second image). The terminal device 120 receives the second recognized text fed back by the text recognition model 160.
[0059] For example, Figure 2C and Figure 2E As shown, the image 208c can be added to the cell 202a, and the terminal device 120 can provide the image 208c to the text recognition model 160, and the text recognition model 160 performs text recognition on the image 208c to obtain text 209d (for example, it can include the characters "ZZZZZZZZZZZZ"). The terminal device 120 can add the text 209 to the cell 202c to replace the text 209b in the cell 202c. The terminal device 120 can also merge the text 209b with the text 209c in the cell 202b to form text 209e, and add the text 209e to the cell 202b to replace the text 209c in the cell 202b.
[0060] In some embodiments, the terminal device 120 may add the field value of the target field extracted from the target text to the extracted data unit of the target document. In this way, the editability and convenience of the target document can be improved. The target field here can be any field in the target text, and the field value corresponds to the target field, and the field value may include but is not limited to text, numbers, symbols, etc. For example, the target field may include but is not limited to name, gender, address, date, number, product, category, customer, company name, question, answer, etc. When the target field is an address, the field value may include a combination of text and numbers. When the target field is a date, the field value may include numbers (for example, XXXX-XX-XX) or a combination of numbers and text (for example, XXXX-XX-XX). The extracted data unit here is similar to the full text unit and the incremental text unit, and can be any data unit in the target document. Taking the target document as a table as an example, the extracted data unit can be any cell in the table. Exemplarily, as Figure 2F As shown, when the target field is "number", the terminal device can extract the field value 209f (for example, 12345) of "number" from the text 209e, and add the field value 209f to the cell 202d.
[0061] In some embodiments, the terminal device 120 may receive a text extraction instruction for a target field, the text extraction instruction including at least an identifier of a full text unit and a field feature for characterizing the target field. The terminal device 120 may provide the target text and the text extraction instruction to the target model 180, so that the target model 180 extracts the field value of the target field from the target text based on the text extraction instruction. The terminal device 120 may add the field value fed back by the target model 180 to the extracted data unit.
[0062] Alternatively or additionally, the terminal device 120 may send the target text and the text extraction instruction to the server 170 , and the server 170 may send the target text and the text extraction instruction to the target model 180 .
[0063] The identification of the full text unit here may include various information that can identify the full text unit. For example, taking the target document as a table, the full text unit may be a cell, and the identification of the full text unit may include but is not limited to row headers, column headers, cell coordinates, etc. It is understandable that when the target document is other documents, the full text unit can also be identified by other information.
[0064] The field feature here is used to indicate the target field. It should be understood that the field feature may include various feature information that can indicate the target field. Alternatively or additionally, the field feature includes but is not limited to the target field itself, a text sequence used to describe the target field, or an identifier that can indicate the target field, etc.
[0065] In some embodiments, the terminal device 120 may present an instruction input box and an instruction confirmation control in response to an instruction input request. The terminal device 120 may receive user input to the instruction input box. The terminal device 120 may also determine the user input received in the instruction input box as a text extraction instruction in response to receiving a trigger operation to the instruction confirmation control. Alternatively or additionally, the text extraction instruction may be written in a natural language.
[0066] For example, Figure 2F and Figure 2G As shown, in example 200G, the user 140 can trigger the "Field 3" title 201d through the terminal device 120 or the attached device of the terminal device 120 to generate an instruction input request. The terminal device 120 can present an instruction input pop-up window 220 on the editing page in response to the instruction input request. The instruction input pop-up window 220 may include an instruction input box 221, an instruction confirmation control 222, and an instruction cancel control 223. The user 140 can input a text prompt instruction 224 into the instruction input box 221 through the terminal device 120 or the attached device of the terminal device 120. For example, please extract [Number] from [Field 1]. Only [Number] should be given in your answer, and no other additional content should be fed back. The text extraction instruction 224 includes an identifier 225 of the full text unit (for example, [Field 1]). The text extraction instruction also includes a field feature 226 (for example, [Number]) used to characterize the target field. The terminal device 120 may send the text extraction instruction 224 to the server 170 in response to the triggering operation of the instruction confirmation control 222, and provide the text extraction instruction 224 to the target model 180 through the server 170, triggering the target model 180 to determine the target value of the target field. Afterwards, the server 170 may feed back the field value 209f (e.g., 12345) determined by the target model 180 to the terminal device 120. The terminal device 120 may add the field value 209f to the cell 202d, as shown in FIG. Figure 2F shown.
[0067] In summary, according to the embodiments of the present disclosure, it is possible to recognize text in at least one image, merge at least one recognized text, and add the merged text to the data unit of the target document, thereby providing a convenient solution for text recognition and text editing of multiple images.
[0068] Example procedures, equipment and devices
[0069] Figure 3 A flowchart of a process 300 for document processing according to some embodiments of the present disclosure is shown. The process 300 may be implemented at the terminal device 120, or may be implemented by the terminal device 120 and the server 170 in collaboration.
[0070] In block 310 , the terminal device 120 receives an operation of adding at least one first image to an image data unit in a target document.
[0071] In box 320 , the terminal device 120 obtains at least one first recognition text corresponding to at least one first image, each of which is obtained by text recognition of the corresponding first image.
[0072] In block 330 , the terminal device 120 merges the at least one first recognized text into a target text according to the order in which the at least one first image is added.
[0073] In block 340 , the terminal device 120 may add the target text to the full text unit corresponding to the image data unit in the target document.
[0074] In some embodiments, the process 300 further includes: adding the first recognized text corresponding to the most recently added first image among the at least one first recognized text to the incremental text unit corresponding to the image data unit.
[0075] In some embodiments, process 300 also includes: receiving an operation of adding a second image to an image data unit, the second image being different from at least one first image; replacing a first recognized text in an incremental text unit with a second recognized text corresponding to the second image, the second recognized text being obtained by text recognition of the second image; and adding the second recognized text to a full text unit to update a target text in the full text unit.
[0076] In some embodiments, receiving an operation to add at least one first image to an image data unit in a target document includes: in response to an edit request for the target document, presenting the target document on an editing page, the editing page including an image adding control; and in response to receiving a trigger operation for the image adding control, adding at least one first image to the image data unit through the image adding control.
[0077] In some embodiments, obtaining at least one first recognized text includes: providing at least one first image to a text recognition model so that the text recognition model performs text recognition on the at least one first image; and receiving at least one first recognized text fed back by the text recognition model.
[0078] In some embodiments, process 300 further includes adding the field value of the target field extracted from the target text to the extracted data unit of the target document.
[0079] In some embodiments, adding the field value of the target field extracted from the target text to the extracted data unit of the target document includes: receiving a text extraction instruction for the target field, the text extraction instruction including at least an identifier of the full text unit and field features for characterizing the target field; providing the target text and the text extraction instruction to a target model so that the target model extracts the field value of the target field from the target text based on the text extraction instruction; and adding the field value fed back by the target model to the extracted data unit.
[0080] In some embodiments, receiving a text extraction instruction includes: in response to an instruction input request, presenting an instruction input box and an instruction confirmation control; receiving user input to the instruction input box; and in response to receiving a trigger operation to the instruction confirmation control, determining the user input received in the instruction input box as a text extraction instruction.
[0081] In some embodiments, the text extraction instructions are written in a natural language.
[0082] The embodiments of the present disclosure also provide corresponding devices for implementing the above methods or processes. Figure 4 An exemplary structural block diagram of an apparatus 400 for document processing according to some embodiments of the present disclosure is shown. The apparatus 400 may be implemented as or included in a terminal device 120. Each module / component in the apparatus 400 may be implemented by hardware, software, firmware, or any combination thereof.
[0083] like Figure 4 As shown, the device 400 may include a receiving module 410, an acquisition module 420, a merging module 430 and an adding module 440. The receiving module 410 is configured to receive an operation of adding at least one first image to an image data unit in a target document. The acquisition module 420 is configured to acquire at least one first recognition text corresponding to the at least one first image, each first recognition text being obtained by text recognition of the corresponding first image. The merging module 430 is configured to merge the at least one first recognition text into a target text according to the order of adding the at least one first image. The adding module 440 is configured to add the target text to the full text unit corresponding to the image data unit in the target document.
[0084] In some embodiments, the adding module 440 is further configured to add the first recognized text corresponding to the most recently added first image among the at least one first recognized text to the incremental text unit corresponding to the image data unit.
[0085] In some embodiments, the adding module 440 is also configured to: receive an operation of adding a second image to the image data unit, the second image being different from at least one first image; replace the first recognized text in the incremental text unit with a second recognized text corresponding to the second image, the second recognized text being obtained by text recognition of the second image; and add the second recognized text to the full text unit to update the target text in the full text unit.
[0086] In some embodiments, the adding module 440 is further configured to: in response to an editing request for the target document, present the target document on an editing page, the editing page including an image adding control; and in response to receiving a trigger operation on the image adding control, add at least one first image to the image data unit through the image adding control.
[0087] In some embodiments, the acquisition module 420 is further configured to: provide at least one first image to a text recognition model so that the text recognition model performs text recognition on the at least one first image; and receive at least one first recognized text fed back by the text recognition model.
[0088] In some embodiments, the adding module 440 is further configured to add the field value of the target field extracted from the target text to the extracted data unit of the target document.
[0089] In some embodiments, the adding module 440 is further configured to: receive a text extraction instruction for a target field, the text extraction instruction including at least an identifier of a full text unit and field features for characterizing the target field; provide the target text and the text extraction instruction to a target model so that the target model extracts the field value of the target field from the target text based on the text extraction instruction; and add the field value fed back by the target model to the extracted data unit.
[0090] In some embodiments, the adding module 440 is further configured to: present an instruction input box and an instruction confirmation control in response to an instruction input request; receive user input to the instruction input box; and in response to receiving a trigger operation on the instruction confirmation control, determine the user input received in the instruction input box as a text extraction instruction.
[0091] In some embodiments, the text extraction instructions are written in a natural language.
[0092] The units and / or modules included in the device 400 can be implemented in various ways, including software, hardware, firmware, or any combination thereof. In some embodiments, one or more units and / or modules can be implemented using software and / or firmware, such as machine executable instructions stored on a storage medium. In addition to or as an alternative to machine executable instructions, some or all of the units and / or modules in the device 400 can be implemented at least in part by one or more hardware logic components. As an example and not limitation, exemplary types of hardware logic components that can 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.
[0093] It should be understood that one or more steps in the above method can be performed by a suitable electronic device or a combination of electronic devices. Such an electronic device or a combination of electronic devices may include, for example, Figure 1 The terminal device 120 in.
[0094] Figure 5 1 shows a block diagram of an electronic device 500 in which one or more embodiments of the present disclosure may be implemented. It should be understood that Figure 5 The electronic device 500 shown is merely exemplary and should not constitute any limitation on the functionality and scope of the embodiments described herein. Figure 5 The electronic device 500 shown can be used to implement Figure 1 The terminal device 120, or for implementing Figure 4 Device 400.
[0095] like Figure 5 As shown, the electronic device 500 is in the form of a general electronic device. The components of the electronic device 500 may include, but are not limited to, one or more processors or processing units 510, a processing unit 520, a storage device 530, one or more communication units 540, one or more input devices 550, and one or more output devices 560. The processing unit 510 may be an actual or virtual processor and is capable of performing various processes according to a program stored in the processing unit 520. In a multi-processor system, multiple processing units execute computer executable instructions in parallel to improve the parallel processing capability of the electronic device 500.
[0096] The electronic device 500 typically includes a plurality of computer storage media. Such media may be any accessible media that is accessible to the electronic device 500, including but not limited to volatile and non-volatile media, removable and non-removable media. The processing unit 520 may be a volatile memory (e.g., registers, caches, random access memory (RAM)), a non-volatile memory (e.g., a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), flash memory), or some combination thereof. The storage device 530 may be a removable or non-removable medium, and may include a machine-readable medium, such as a flash drive, a disk, or any other medium, which may be capable of being used to store information and / or data and may be accessed within the electronic device 500.
[0097] The electronic device 500 may further include additional removable / non-removable, volatile / non-volatile storage media. Figure 5 As shown in , a disk drive for reading or writing from a removable, non-volatile disk (e.g., a "floppy disk") and an optical drive for reading or writing from a removable, non-volatile optical disk may be provided. In these cases, each drive may be connected to the bus (not shown) by one or more data media interfaces. Processing unit 520 may include a computer program product 525 having one or more program modules that are configured to perform various methods or actions of various embodiments of the present disclosure.
[0098] The communication unit 540 implements communication with other electronic devices through a communication medium. Additionally, the functions of the components of the electronic device 500 can be implemented in a single computing cluster or multiple computing machines that can communicate through a communication connection. Therefore, the electronic device 500 can operate in a networked environment using a logical connection with one or more other servers, a network personal computer (PC), or another network node.
[0099] The input device 550 may be one or more input devices, such as a mouse, a keyboard, a tracking ball, etc. The output device 560 may be one or more output devices, such as a display, a speaker, a printer, etc. The electronic device 500 may also communicate with one or more external devices (not shown) through the communication unit 540 as needed, such as a storage device, a display device, etc., communicate with one or more devices that allow a user to interact with the electronic device 500, or communicate with any device that allows the electronic device 500 to communicate with one or more other electronic devices (e.g., a network card, a modem, etc.). Such communication may be performed via an input / output (I / O) interface (not shown).
[0100] According to an exemplary implementation of the present disclosure, a computer-readable storage medium is provided, on which computer-executable instructions are stored, wherein the computer-executable instructions are executed by a processor to implement the method described above. According to an exemplary implementation of the present disclosure, a computer program product is also provided, which is tangibly stored on a non-transitory computer-readable medium and includes computer-executable instructions, and the computer-executable instructions are executed by a processor to implement the method described above.
[0101] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices, equipment, and computer program products implemented according to the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0102] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0103] Computer-readable program instructions can be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operational steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, so that the instructions executed on the computer, other programmable data processing apparatus, or other device implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0104] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple implementations of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of a module, program segment or instruction includes one or more executable instructions for realizing the logical function of the specification. In some implementations as an update, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the function 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 realized by a special hardware-based system that performs the function or action of the specification, or can be realized by a combination of special hardware and computer instructions.
[0105] The above descriptions of various implementations of the present disclosure are exemplary, non-exhaustive, and not limited to the disclosed implementations. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described implementations. The selection of terms used herein is intended to best explain the principles of the implementations, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the various implementations disclosed herein.
Claims
1. A method for document processing, comprising: receiving an operation of adding at least one first image to an image data unit in a target document; Acquire at least one first recognition text corresponding to the at least one first image, wherein the first recognition text is obtained by text recognition of the corresponding first image; Merging the at least one first recognized text into a target text according to the order in which the at least one first image is added; as well as The target text is added to the full text unit corresponding to the image data unit in the target document.
2. The method according to claim 1, further comprising: A first recognized text corresponding to the most recently added first image among the at least one first recognized text is added to an incremental text unit corresponding to the image data unit.
3. The method according to claim 2, further comprising: receiving an operation of adding a second image to the image data unit, the second image being different from the at least one first image; replacing the first recognized text in the incremental text unit with the second recognized text corresponding to the second image, wherein the second recognized text is obtained by text recognition of the second image; as well as The second recognized text is added to the full text unit to update the target text in the full text unit.
4. The method according to claim 1, wherein receiving the operation of adding at least one first image to the image data unit in the target document comprises: In response to an edit request for the target document, presenting the target document on an edit page, the edit page including an image adding control; as well as In response to receiving a trigger operation on the image adding control, the at least one first image is added to the image data unit through the image adding control.
5. The method according to claim 1, wherein obtaining the at least one first recognized text comprises: providing the at least one first image to a text recognition model so that the text recognition model performs text recognition on the at least one first image; as well as The at least one first recognized text fed back by the text recognition model is received.
6. The method according to claim 1, further comprising: A field value of a target field extracted from the target text is added to an extracted data unit in the target document.
7. The method according to claim 6, wherein adding the field value of the target field to the extracted data unit comprises: Receiving a text extraction instruction for the target field, the text extraction instruction at least including an identifier of the full text unit and a field feature for characterizing the target field; providing the target text and the text extraction instruction to a target model, so that the target model extracts the field value of the target field from the target text based on the text extraction instruction; as well as The field value fed back by the target model is added to the extracted data unit.
8. The method according to claim 7, wherein receiving a text extraction instruction comprises: In response to the instruction input request, presenting an instruction input box and an instruction confirmation control; receiving user input to the instruction input box; as well as In response to receiving a trigger operation on the instruction confirmation control, the user input received in the instruction input box is determined as the text extraction instruction.
9. The method of claim 7, wherein the text extraction instructions are written in a natural language.
10. An apparatus for document processing, comprising: A receiving module configured to receive an operation of adding at least one first image to an image data unit in a target document; An acquisition module is configured to acquire at least one first recognition text corresponding to the at least one first image, wherein the first recognition text is obtained by text recognition of the corresponding first image; a merging module configured to merge the at least one first recognized text into a target text according to the order in which the at least one first image is added; as well as The adding module is configured to add the target text to the full text unit corresponding to the image data unit in the target document.
11. An electronic device, comprising: at least one processing unit; as well as At least one memory, the at least one memory being coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit, the instructions causing the electronic device to perform the method according to any one of claims 1 to 9 when executed by the at least one processing unit.
12. A computer-readable storage medium having a computer program stored thereon, wherein the computer program can be executed by a processor to implement the method according to any one of claims 1 to 9.
13. A computer program product, comprising a computer program, wherein the computer program, when executed by a processor, implements the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Document display method, related device, equipment and storage medium
CN114398858A
Content extraction method and device of professional document, equipment and storage medium
CN116071772A
PDF (Portable Document Format) document processing method and device, equipment and medium
CN117173729A
Method, apparatus and platform of generating document, electronic device, storage medium and program product
EP4105896A2
Methods and systems for identifying fields in a document
RU2760471C1
