This application is based on and claims priority under 35 USC 119 from Japanese Patent Application No. 2021-054198 filed Mar. 26, 2021.
The present invention relates to an information processing apparatus and a non-transitory computer readable medium storing a program.
JP2004-348591A discloses a document search method for searching a document including a text recognition process of executing text recognition processing on an image of a search document, a misrecognized text processing process of applying predetermined processing to a word or a text that is presumed to be misrecognition from text data obtained by executing the text recognition processing, a generation process of generating text feature information based on the text data processed by the misrecognized text processing process, and a search process of using the text feature information generated in the generation process as a query, searching for holding means for holding the text feature information for each of a plurality of documents, and acquiring a document corresponding to the search document from the plurality of documents.
There is processing executed by outputting a text code string obtained by text recognition of document data. On the other hand, some document data includes a text code string, and in a case where the text code string is output, an accuracy of the output text code string is improved as compared with a case of outputting the text code string obtained by text recognition of the document data. However, in order to be consistent with the processing executed by outputting the text code string obtained by text recognition of document data, even in a case where the document data includes a text code string, the text code string obtained by text recognition of the document data is output, and this may not improve the accuracy of the output text code string.
Aspects of non-limiting embodiments of the present disclosure relate to an information processing apparatus and a non-transitory computer readable medium storing a program that improve an accuracy of an output text code string as compared with a configuration of outputting a text code string obtained by text recognition of document data even in a case where the document data includes the text code string.
Aspects of certain non-limiting embodiments of the present disclosure overcome the above disadvantages and/or other disadvantages not described above. However, aspects of the non-limiting embodiments are not required to overcome the disadvantages described above, and aspects of the non-limiting embodiments of the present disclosure may not overcome any of the disadvantages described above.
According to an aspect of the present disclosure, there is provided an information processing apparatus including a processor configured to acquire specific document data, and in a case where the specific document data includes a text code string, output the text code string included in the specific document data as input data for processing executed by outputting a text code string obtained by text recognition of document data in a predetermined format, in the predetermined format.
Exemplary embodiment(s) of the present invention will be described in detail based on the following figures, wherein:
Hereinafter, an exemplary embodiment of the present invention will be described in detail with reference to the drawings.
The present exemplary embodiment provides an information processing apparatus that acquires specific document data and outputs, in a case where the specific document data includes a text code string, the text code string included in the specific document data as input data for processing executed by outputting a text code string obtained by text recognition of document data in a predetermined format, in the predetermined format.
Further, in a case where the specific document data further includes text coordinates, the information processing apparatus may further output the text coordinates included in the specific document data as input data for processing executed by outputting a text code string and text coordinates obtained by text recognition of document data in a predetermined format, in the predetermined format.
As described above, the information processing apparatus may output the text code string included in the specific document data in the predetermined format, or may output the text code and text coordinates included in the specific document data in the predetermined format, but the latter will be described below as an example.
Further, the processing executed by outputting the text code string obtained by text recognition of the document data in the predetermined format may be any processing, but business processing performed by a business processing system will be described as an example. Then, the information processing apparatus will be described as a business processing support system that supports the business processing.
Further, the information processing apparatus determines whether or not specific document data includes a text code string. In that case, the specific document data may consist of a plurality of pages, and the information processing apparatus may determine whether or not the specific document data includes a text code string for each page.
In the present exemplary embodiment, processing may be performed on the entire electronic document, but in the following, a case where processing is performed for each page as described above will be described as an example.
Furthermore, in a case where specific document data includes a text code string and image data, the information processing apparatus may output a combined text code string obtained by combining the text code string included in the specific document data and a text code string obtained by text recognition of image data in a predetermined format.
In the present exemplary embodiment, the information processing apparatus does not have to perform such an operation, but in the following, a case where such an operation is also performed will be described as an example.
Overall Configuration of Computer System
The business processing system 10 is a system that performs some business processing on input data. The business processing system 10 may include, for example, a workflow system that performs approval processing and the like for input data according to a workflow, and an accounting system that performs accounting processing on data after the approval processing or the like is performed on the input data.
The business processing support system 20 is a system that supports business processing by the business processing system 10, by acquiring text string information from an input electronic document and inputting the input data obtained from the text string information into the business processing system. Here, the text string information is information related to a text string, and is information including a text code and text coordinates for each text included in the text string.
The communication line 80 is a line used for information communication between the business processing system 10 and the business processing support system 20. As the communication line 80, for example, a local area network (LAN) or the Internet may be used.
Hardware Configuration of Business Processing Support System
Therefore, the business processing support system 20 converts the text string information directly output from the page 500 into a format in a case of outputting the text recognition result shown in
Functional Configuration of Business Processing Support System
The document reception unit 31 receives an input electronic document. At that time, the document reception unit 31 inspects that the input electronic document is in a processable format. Here, PDF and the like are exemplified as the format of the electronic document. In the present exemplary embodiment, the processing of the document reception unit 31 is performed as an example of acquiring specific document data.
The page division unit 32 divides the electronic document received by the document reception unit 31 into a plurality of pages. Then, the page division unit 32 delivers the plurality of pages obtained by dividing the electronic document to the text string information extraction unit 33 in order from a first page to a last page.
The text string information extraction unit 33 attempts to extract the text string information from the page delivered from the page division unit 32, and determines whether or not the extraction of the text string information is successful. In a case where it is not determined that the extraction of the text string information from the page delivered from the page division unit 32 is successful, the text string information extraction unit 33 delivers the page to the image conversion unit 34. Further, in a case where it is determined that the extraction of the text string information from the page delivered from the page division unit 32 is successful, the text string information extraction unit 33 delivers the extracted text string information and the page to the format conversion unit 37. Here, the successful extraction of the text string information from the page means that the page includes the text string information. In the present exemplary embodiment, the processing of the text string information extraction unit 33 is performed as an example of determining whether or not the specific document data includes the text code string.
The image conversion unit 34 performs image conversion on the page delivered from the text string information extraction unit 33 or the page delivered from the image extraction unit 38 as described later. For example, the image conversion unit 34 may perform image conversion by printing a page delivered from the text string information extraction unit 33 or the image extraction unit 38 with a printing apparatus and reading the page with an image reading apparatus. Alternatively, the image conversion unit 34 may perform image conversion on the page delivered from the text string information extraction unit 33 or the image extraction unit 38, for example, by software. Then, the image conversion unit 34 delivers the image data generated by the image conversion to the text recognition unit 35. Here, as a format of the image data, JPG, TIFF, and the like are exemplified.
The text recognition unit 35 performs text recognition on the image data delivered from the image conversion unit 34, and delivers a file of the text recognition result in a predetermined format to the file output unit 39. At that time, in a case where the image conversion unit 34 receives information on the position of the image in the page from the image extraction unit 38 as described later, the text recognition unit 35 performs text recognition with respect to the image in the page specified by the position information. Then, in a case where the text recognition of the image is successful, the text recognition unit 35 delivers the file of the text recognition result in the predetermined format to the file output unit 39. Further, in a case where the text recognition of the image is not successful, the text recognition unit 35 notifies the file output unit 39 to that effect.
The format conversion unit 37 converts the text string information delivered from the text string information extraction unit 33 into a file in the same predetermined format as the format in a case where the text recognition unit 35 outputs the text recognition result. Here, for example, the format conversion unit 37 may hold in advance the format in a case where the text recognition unit 35 outputs the text recognition result. Then, the format conversion unit 37 delivers the file in the predetermined format generated by the format conversion to the file output unit 39. Further, the format conversion unit 37 delivers the page delivered from the text string information extraction unit 33 to the image extraction unit 38.
The image extraction unit 38 attempts to extract an image from the page delivered from the format conversion unit 37, and determines whether or not the extraction of an image of 1/N or more of the page is successful. In a case where the image extraction unit 38 determines that the extraction of the image of 1/N or more of the page is successful, the image extraction unit 38 delivers the page to the image conversion unit 34 together with the information on the position of the image. Further, in a case where it is not determined that the extraction of the image of 1/N or more of the page is successful, the image extraction unit 38 notifies the file output unit 39 to that effect.
The file output unit 39 receives and holds the file from the text recognition unit 35 or the format conversion unit 37 for each page from the first page to the last page. At that time, in a case where the file output unit 39 receives files from both the text recognition unit 35 and the format conversion unit 37 because the page includes the text string information and the image of 1/N or more of the page, the file output unit 39 merges and holds the files. Further, in a case where the text recognition unit 35 notifies that the text recognition of the image in the page is not successful, or in a case where the image extraction unit 38 notifies that the extraction of the image of 1/N or more of the page is not successful, the file output unit 39 receives and holds a file only from the format conversion unit 37. Then, in a case where the file output unit 39 receives the file for the last page, the file output unit 39 collectively outputs the received files for the last page from the first page to the business processing system 10 (refer to
That is, for a page that does not include text string information, a file in a predetermined format obtained by text recognition of the page is delivered from the text recognition unit 35, so that the file output unit 39 outputs the file in the predetermined format. Further, for a page that includes text string information, the text string information is converted into a file in a predetermined format and delivered from the format conversion unit 37, so that the file output unit 39 outputs a file in the predetermined format. In the present exemplary embodiment, in a case where the specific document data includes a text code string, the processing of the file output unit 39 is performed as an example of outputting the text code string included in the specific document data as input data for processing executed by outputting the text code string obtained by text recognition of the document data in a predetermined format, in the predetermined format. That is, in the present exemplary embodiment, a page that includes the text string information is used as an example of the first page that includes the text code string, and a page that does not include the text string information is used as an example of the second page that does not include the text code string. Then, the processing of the file output unit 39 is performed as an example of outputting the text code string included in the first page in a format in which a text code string obtained by text recognition of the second page is output, as the predetermined format.
Further, for the page that includes the text string information and the image, the file output unit 39 merges and outputs the file in the predetermined format delivered from the text recognition unit 35 and the file in the predetermined format delivered from the format conversion unit 37. In the present exemplary embodiment, in a case where the specific document data includes the text code string and the image data, the processing of the file output unit 39 is performed as an example of outputting a combined text code string obtained by combining the text code string included in the specific document data and the text code string obtained by text recognition of image data, in the predetermined format. At that time, the file output unit 39 may be subject to the condition that 1/N or more of the image of the page is extracted from the page that includes the text string information and the image. In that case, the processing performed by the file output unit 39 is an example of outputting the combined text code string in the predetermined format in a case where the ratio of the area of the image data to the area of the specific document data is equal to or more than the threshold.
Operation of Business Processing Support System
In the business processing support system 20, first, the document reception unit 31 receives the input electronic document (step S201).
Next, the page division unit 32 divides the electronic document received in step S201 into a plurality of pages (step S202). Then, the page division unit 32 repeats the processing from step S203 to step S218 by delivering the plurality of pages obtained in step S202 to the text string information extraction unit 33 in order from the first page to the last page.
That is, first, the text string information extraction unit 33 attempts to extract text string information from one of the plurality of pages obtained in step S202 (step S203). Then, the text string information extraction unit 33 determines whether or not the extraction of the text string information is successful (step S204).
First, a case where it is not determined that the extraction of the text string information is successful in step S204 will be described.
In this case, the image conversion unit 34 performs image conversion on the page (step S205). Then, the text recognition unit 35 performs text recognition on the page for which the image conversion has been performed in step S205 (step S206). As a result, the file output unit 39 holds the file of the text recognition result (step S207).
Next, a case where it is determined in step S204 that the extraction of the text string information has been successfully performed will be described.
In this case, the format conversion unit 37 converts the text string information extracted in step S203 into the same format as the file held in step S207 (step S208). Here, for example, the format conversion unit 37 may hold the format in advance.
Next, the image extraction unit 38 attempts to extract an image of 1/N or more of the page (step S209). Then, the image extraction unit 38 determines whether or not the extraction of the image of 1/N or more of the page is successful (step S210).
In a case where it is not determined in step S210 that the extraction of the image of 1/N or more of the page is successful, the file output unit 39 holds the file obtained by the format conversion in step S208 (step S211).
In a case where it is determined in step S210 that the extraction of the image of 1/N or more of the page is successful, the image extraction unit 38 specifies the position of the image (step S212).
Next, the image conversion unit 34 performs image conversion on the page (step S213). Then, the text recognition unit 35 performs text recognition with respect to the image of which position is specified in step S212 in the page for which image conversion has been performed in step S213 (step S214). As a result, the text recognition unit 35 determines whether or not the text recognition is successful (step S215).
In a case where it is not determined in step S215 that the text recognition is successful, the file output unit 39 holds the file obtained by the format conversion in step S208 (step S211).
In a case where it is determined in step S215 that the text recognition is successful, the file output unit 39 merges and holds the file obtained by the format conversion in step S208 and the file of the text recognition result in step S214 (step S216).
After that, the page division unit 32 determines whether or not the last page among the plurality of pages obtained in step S202 has been reached (step S217).
In a case where it is not determined that the last page has been reached in step S217, the page division unit 32 moves to the next page among the plurality of pages obtained in step S202 (step S218). That is, the page division unit 32 delivers the next page to the text string information extraction unit 33, and performs the processing after step S203.
In a case where it is determined that the last page has been reached in step S217, the file output unit 39 collects the files for each page held in step S207, step S211, or step S216 for the plurality of pages obtained in step S202 to output to the business processing system 10 (step S219).
Processor
In the embodiments above, the term “processor” refers to hardware in abroad sense. Examples of the processor include general processors (e.g., CPU: Central Processing Unit) and dedicated processors (e.g., GPU: Graphics Processing Unit, ASIC: Application Specific Integrated Circuit, FPGA: Field Programmable Gate Array, and programmable logic device).
In the embodiments above, the term “processor” is broad enough to encompass one processor or plural processors in collaboration which are located physically apart from each other but may work cooperatively. The order of operations of the processor is not limited to one described in the embodiments above, and may be changed.
Program
The processing performed by the business processing support system 20 in the present exemplary embodiment is prepared as, for example, a program such as application software.
That is, the program that realizes the present exemplary embodiment may be regarded as a program for causing a computer to realize a function of acquiring specific document data in the computer, and a function of outputting, in a case where the specific document data includes a text code string, the text code string included in the specific document data as input data for processing executed by outputting a text code string obtained by text recognition of document data in a predetermined format, in the predetermined format.
Note that the program that realizes the present exemplary embodiment may be provided not only by communication means but also by storing the program in a recording medium such as a CD-ROM.
The foregoing description of the exemplary embodiments of the present invention has been provided for the purposes of illustration and description. It is not intended to be exhaustive or to limit the invention to the precise forms disclosed. Obviously, many modifications and variations will be apparent to practitioners skilled in the art. The embodiments were chosen and described in order to best explain the principles of the invention and its practical applications, thereby enabling others skilled in the art to understand the invention for various embodiments and with the various modifications as are suited to the particular use contemplated. It is intended that the scope of the invention be defined by the following claims and their equivalents.
Number | Date | Country | Kind |
---|---|---|---|
2021-054198 | Mar 2021 | JP | national |