Table recognition device and method
The table recognition device integrates character strings across multiple ruled lines using a knowledge database and weighted recognition to address inaccuracies in conventional methods, ensuring accurate character recognition despite varying line frames and errors.
Patent Information
- Application Number
- JP2024523957
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2022-10-17
- Publication Date
- 2024-10-08
- Estimated Expiration
- 2042-10-17
AI Technical Summary
Conventional character recognition technologies fail to accurately recognize character strings that span across multiple ruled lines in a table when the ruled line frames have different types or the preset conditions are not satisfied.
A table recognition device and method that integrates character strings across multiple ruled line frames by determining the likelihood of matching with pre-defined item names or values using a knowledge database, without relying on ruled line frame information, and optionally using table structure constraints and weighted character recognition to improve accuracy.
Accurately recognizes character strings across multiple ruled lines, correcting errors and improving integration accuracy by leveraging a knowledge database and weighted character recognition, even with varying ruled line frames or recognition errors.
Smart Images

Figure 0007563655000001 
Figure 0007563655000002 
Figure 0007563655000003
Abstract
Description
[Technical field]
[0001] The present disclosure relates to a table recognition device and method for performing character recognition from image information of a table-format document. [Background technology]
[0002] In character recognition of an image of a table-format document, the table's ruled lines are extracted and the rows and columns of the table are separated into multiple areas (multiple ruled frames) by the ruled lines. Character recognition is then performed for each ruled frame, and the character recognition results are stored separately. For this reason, if a single item name or item value is written across multiple ruled frames, such as when the character string within a ruled frame that is to become an item name or item value exceeds the ruled frame and spills over into an adjacent ruled frame, the item name or item value (character string) may not be recognized.
[0003] Therefore, a technology has been disclosed that recognizes an item name or item value (character string) by merging ruled frames when the ruled frame information of adjacent ruled frames satisfies a preset condition, for example, when adjacent ruled frames are both drawn with solid lines of the same thickness (for example, Patent Document 1). According to this conventional technique, it is possible to recognize a character string that is written across multiple ruled frames. [Prior art documents] [Patent documents]
[0004] [Patent Document 1] JP 2017-097805 A Summary of the Invention [Problem to be solved by the invention]
[0005] However, the conventional technology has the following problems. For example, adjacent ruled frame information may differ, such as the types of lines in adjacent ruled frames being different, and in such cases, the preset conditions are not met. Therefore, it is not possible to recognize a character string that is written across multiple ruled frames that do not meet the conditions.
[0006] The present disclosure has been made to solve the above-mentioned problems, and aims to enable accurate recognition of character strings written across multiple ruled frames without relying on ruled frame information. [Means for solving the problem]
[0007] The table recognition device of the present disclosure is A table recognition device that recognizes character strings described in a table-formatted document from image information of the table-formatted document, a character recognition unit that recognizes character strings written within each of a plurality of ruled frames provided in the table format document; a single character string that is a character string recognized for a target ruled frame that is a target ruled frame among the plurality of ruled frame, and a concatenated character string that is a concatenation of a character string recognized for a ruled frame other than the target ruled frame and the single character string, The apparatus further includes a ruled line frame integration determination unit that determines the single character string or the concatenated character string that has a higher degree of match with the matching character string to be written in the table format document as an integrated character string that belongs to the target ruled line frame.
[0008] The table recognition method of the present disclosure comprises: A table recognition method for recognizing a character string described in a table-formatted document from image information of the table-formatted document, comprising the steps of: a character recognition unit that recognizes character strings written within each of a plurality of ruled frames provided in the table format document; a single character string that is a character string recognized for a target ruled line frame that is a target ruled line frame among the plurality of ruled line frames, and a concatenated character string that is a concatenation of a character string recognized for a ruled line frame other than the target ruled line frame and the single character string, The character string or the concatenated character string that matches the matching character string to be written in the table format document is determined as an integrated character string that belongs to the target ruled frame. Effect of the Invention
[0009] According to the present disclosure, it is possible to accurately recognize a character string that is written across multiple ruled frames without relying on ruled frame information. [Brief description of the drawings]
[0010] [Figure 1] FIG. 2 is a functional configuration diagram showing the configuration of the table recognition device in the first embodiment. [Diagram 2] 2 is a diagram illustrating an example of a table-format document to be recognized by the table recognition device in the first embodiment. FIG. [Diagram 3] FIG. 2 is a diagram illustrating an example of a knowledge database according to the first embodiment. [Figure 4] FIG. 2 is a hardware configuration diagram of the table recognition device according to the first embodiment. [Diagram 5] 4 is a flowchart showing an operation sequence of the table recognition device in the first embodiment. [Figure 6] 13 is a flowchart illustrating an operation sequence of a ruled line frame integration determination unit according to the first embodiment. [Figure 7] FIG. 4 is a diagram illustrating an example of the operation of the table recognition device in the first embodiment. [Figure 8] FIG. 11 is a functional configuration diagram showing the configuration of a table recognition device in embodiment 2. [Figure 9] FIG. 11 is a diagram illustrating an example of a table structure knowledge database in the second embodiment. [Figure 10] 13 is a flowchart showing the operation sequence of a ruled line integration determination unit in the second embodiment. [Figure 11] FIG. 13 is a diagram illustrating an example of the operation of the table recognition device in the third embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0011] In the description of the embodiments and the drawings, the same elements and corresponding elements are given the same reference numerals. Descriptions of elements given the same reference numerals are omitted or simplified as appropriate. In the following embodiments, "unit" may be read as "circuit", "step", "procedure" or "process" as appropriate.
[0012] Embodiment 1 <Configuration> The table recognition device in the embodiment 1 will be described with reference to Fig. 1 to Fig. 7. Fig. 1 is a functional block diagram showing the configuration of a table recognition device 100 in the embodiment 1. In Fig. 1, the table recognition device 100 is made up of a table structure recognition unit 1, a character recognition unit 2, a ruled line frame comprehensive determination unit 3, and a knowledge database 4.
[0013] FIG. 2 is a diagram showing an example of a tabular document to be recognized by the table recognition device 100 in the first embodiment. In the first row and first column of the table shown in FIG. 2, the item name "Item A" is written, in the second column, "Item B" is written, and in the third column, "Item C" is written. In the second and subsequent rows of the table, the item values belonging to the respective item names are written. As shown in FIG. 2, in a tabular document, due to the influence of printing or the number of characters being excessive, characters may protrude from the ruled frame or characters may touch the ruled frame. Specifically, in the case of the table shown in FIG. 2, the item value "Total Fat" belonging to the item name "Item A" is in a state where the character "at" protrudes from the ruled frame of the item name "Item B". Also, the item value "Saturated Fat" belonging to the item name "Item B" is in a state where the initial character "S" touches the ruled frame.
[0014] The table structure recognition unit 1 extracts ruled lines from image information of a table format document and recognizes the table structure. The table structure is made up of multiple areas (i.e., multiple ruled frames) in which rows and columns of the table are separated by ruled lines.
[0015] The method of recognizing the table structure may be, for example, a method based on edge histograms. Specifically, edges in two directions are obtained near the boundaries of white pixel clusters inside the table area (table area) from the image information of the table format document. Here, the white pixel cluster is a white area surrounded by a ruled frame of a color other than white. Then, partial information of the ruled lines is obtained based on the edge histograms obtained from each of the obtained edges in the two directions. Furthermore, ruled line information of the table area is obtained based on the obtained partial information of the ruled lines, and the table structure is recognized. Note that the method of recognizing the table structure is not limited to this. For example, various methods can be used as long as they can obtain information on the row and column structure of a table.
[0016] The character recognition unit 2 recognizes the character string within the ruled frame by using, for example, an optical character recognition (OCR) technique. Note that the method for recognizing the character string within the ruled frame is not limited to OCR, and other methods may be used.
[0017] The ruled line frame integration determination unit 3 determines which ruled line frames should be integrated according to the degree of match between the character string recognized by the character recognition unit 2 and the matching character string registered in the knowledge database 4. In other words, it determines whether the character string in each ruled line frame should be linked to the character string in the adjacent ruled line frame on the left or right. For example, the degree of match can be a likelihood. The likelihood is a value that indicates the "likelihood" that an arbitrary character string is estimated to belong to a certain character string group. For example, the likelihood can be the standardized edit distance between two character strings. Here, the standardized edit distance is a value obtained by dividing the edit distance by the length of the longer character string. However, the edit distance is the minimum number of operations required to transform one character string into the other character string by inserting, deleting, or replacing one character. The likelihood may be read as the degree of match between two character strings. Then, based on the judgment result, the character strings within the ruled frame are concatenated, and either the concatenated character string (concatenated character string) or the single character string (unconcatenated character string) is output as an integrated character string, which is the final integration judgment result.
[0018] The knowledge database 4 defines matching strings, which are strings to be written as item names and item values belonging to the item names. FIG. 3 shows an example of the contents of matching strings in the knowledge database 4. In the knowledge database 4, one or more matching strings are registered for each item name. In other words, any of the matching strings for the item values defined in the knowledge database 4 can be written within the ruled frame of the item value for each item name of the tabular document. Note that the matching string is not limited to one word, but may be a phrase or a sentence consisting of multiple words. The IDX in FIG. 3 is an index number that is individually assigned to each matching string. This IDX is used to specify the matching string when referring to the matching string in the knowledge database 4. Specifically, in FIG. 3, for example, index numbers A1, A2, . . . , A9 are assigned to each item value belonging to the item name "Item A" in order. Note that the matching strings are not limited to the strings shown in FIG. 3, and can be set arbitrarily. Furthermore, so-called wildcards that represent any character or number can be set for the item values of the knowledge database 4. Specifically, in the matching strings belonging to the item name "Item C" in FIG. 3, [*NUM*] means a wildcard, and any number can be substituted for the wildcard. By setting wildcards for the item values of the knowledge database 4, it becomes unnecessary to set matching strings for each character or number, and the storage capacity of the knowledge database 4 can be reduced. Also, the amount of calculation required to refer to matching strings for each character or number can be reduced. Furthermore, if the recognized character string has an error as a result of table recognition and satisfies a predetermined condition, it may be replaced with a character string of an item name or an item value registered in the knowledge database 4. Alternatively, a character string of an item name or an item value that is not registered may be excluded from the recognition target as a result of erroneous recognition. Specific conditions for replacement will be described later.
[0019] <Hardware> Next, a description will be given of the hardware of the table recognition device 100 in the embodiment 1. Fig. 4 is a hardware configuration diagram of the table recognition device 100. The table recognition device 100 has a processor 101, a memory 102, an external storage device 103, and an input / output interface 104.
[0020] The processor 101 controls the entire table recognition device 100. For example, the processor 101 is a central processing unit (CPU) or a field programmable gate array (FPGA). The processor 101 may be a multiprocessor. Furthermore, the table recognition device 100 may include a processing circuit.
[0021] The memory 102 is a main storage device of the table recognition device 100. For example, the memory 102 is a RAM (Random Access Memory) or the like. The external storage device 103 is an auxiliary storage device of the table recognition device 100. For example, the external storage device 103 is a HDD (Hard Disk Drive) or an SSD (Solid State Drive) or the like. The input / output interface 104 is an interface that transmits and receives data to and from an external device connected to the table recognition device 100. For example, the input / output interface 104 is a NIC (Network Interface Controller) or the like. For example, the external device is an image scanner, a display, etc. Note that illustration of the external device is omitted.
[0022] Processor 101 reads the table recognition program stored in external storage device 103 into memory 102, and processor 101 executes the program to realize each process of the table recognition method. External storage device 103 holds programs and data for realizing the table recognition method of embodiment 1. The table recognition program may be provided through a network, or may be provided by being recorded on a computer-readable recording medium. That is, the table recognition program may be provided, for example, as a program product.
[0023] An input / output interface 104 receives image information of a table-format document from an external device such as an image scanner, and outputs the table recognition result to an external device such as a display.
[0024] <Flowchart> Next, the operation of table recognition device 100 in embodiment 1 will be described. Fig. 5 is a flowchart showing the operation sequence of table recognition device 100 in embodiment 1. For ease of explanation, it is assumed that the contents of the first row of the table (i.e., the row in which the item names are written) are known, and a method for integrating only the ruled frames of item values from the second row onwards will be described. Also, since processing of the row of item names (first row) will be omitted, the second row, which is the first row of item values, will be considered as the new first row in the explanation.
[0025] First, in step S1, the table structure recognition unit 1 extracts ruled lines from image information of a table format document and recognizes a table structure consisting of multiple ruled lines. Furthermore, the table structure recognition unit 1 obtains the number of rows and the number of columns of each row in the table of the table format document from the recognized table structure (step S1).
[0026] In step S2, the character recognition unit 2 recognizes the characters within the ruled frame recognized by the table structure recognition unit 1 in step S1 (step S2).
[0027] Next, in step S3, the ruled line frame integration determination unit 3 refers to the knowledge database 4 and determines which ruled line frames to integrate based on the character recognition result obtained in step S2. Then, based on the determination result, the unit 3 concatenates character strings in adjacent ruled line frames and outputs a concatenated character string, which is the concatenated character string, or a single character string, which is an unconcatenated single character string (step S3).
[0028] Fig. 6 is a flow chart showing the operation sequence of the ruled line frame integration judgment unit 3 in step S3. In the figure, "←" indicates the process of substituting the value or element on the right side for the variable on the left side. To simplify the explanation, the value held by the variable may be indicated by the symbolic name of the variable. The operation is for a table with the upper left corner as the origin.
[0029] First, in step S301, 1 is substituted into the variable i which indicates the position of a row in the table (step S301).
[0030] In step S302, it is confirmed whether the variable i is equal to or less than the number of rows in the table. If the variable i is equal to or less than the number of rows in the table (Yes in step S302), the process proceeds to step S303. If the variable i is greater than the number of rows in the table (No in step S302), the process ends (END) since the determination of all rows has been completed.
[0031] In step S303, 1 is substituted into variable j, which indicates the position of the column in the table (step S303).
[0032] In step S304, it is confirmed whether the variable j is equal to or less than the total number of ruled frames for item values belonging to row i (hereinafter, the number of items) (step S304). If the variable j is equal to or less than the number of items (Yes in step S304), the process proceeds to step S305. If the variable j exceeds the number of items (No in step S304), the process proceeds to step S316.
[0033] In step S305, it is confirmed whether there is a character recognition result in the ruled frame of the i-th row and the j-th column (step S305). If there is a character recognition result in the ruled frame of the i-th row and the j-th column (Yes in step S305), the process proceeds to step S306. If there is no character recognition result in the ruled frame of the i-th row and the j-th column (No in step S305), the process proceeds to step S315.
[0034] In step S306, 0 is substituted for variable k (step S306). k represents the number of columns of other ruled lines to be merged with the ruled line frame in the jth column of the ith row. Specifically, when k=0, the ruled line frame in the jth column of the ith row is not merged and is treated as a single ruled line frame, and when k=1, one other adjacent ruled line frame is merged with the ruled line frame in the jth column of the ith row.
[0035] In step S307, it is confirmed whether the value of variable k is equal to or less than the value obtained by subtracting the value of variable j and 1 from the number of items (step S307). If the value of variable k is equal to or less than the value obtained by subtracting the value of variable j and 1 from the number of items (Yes in step S307), the process proceeds to step S308. If the value of variable k is greater than the value obtained by subtracting the value of variable j and 1 from the number of items (No in step S307), the process proceeds to step S313.
[0036] In step S308, it is confirmed whether there is a character recognition result within the ruled frame in the (j+k)th column of the i row (step S308). If there is a character recognition result within the ruled frame in the (j+k)th column of the i row (Yes in step S308), the process proceeds to step S309. If there is no character recognition result within the ruled frame in the (j+k)th column of the i row (No in step S308), the process proceeds to step S313.
[0037] In step S309, the ruled frames from the jth column to the (j+k)th column are integrated, and the character strings in the ruled frames are concatenated to obtain a concatenated character string. Then, the knowledge database 4 is referred to, and matching character strings belonging to the jth item name (i.e., the jth column) in the knowledge database 4 are sequentially read out, the likelihood [j+k,j] that the concatenated character string belongs to the item name in the jth column is calculated, and the likelihood L[j+k,j] is substituted for the variable L1 (step S309). As a specific example of a method of referring to the knowledge database 4 in this embodiment, for example, when j=1 (i.e., the first column of the table), matching character strings belonging to the item name "Item A" in the knowledge database 4 are sequentially read out, and when j=2 (i.e., the second column of the table), matching character strings belonging to the item name "Item B" in the knowledge database 4 are sequentially read out. Note that in order to read out matching character strings from the knowledge database 4, the index number IDX can be used as a search key. Specifically, the likelihood [j+k,j] is calculated, for example, as follows: First, one matching string is read out from one or more matching strings registered in the knowledge database 4 as an item value belonging to the jth item name (i.e., the jth column) using the index number IDX as a key. Next, the standardized edit distance NED between a concatenated string obtained by concatenating the strings in the ruled boxes from the jth column to the (j+k)th column and the matching string read out using the index number IDX as a key is calculated. The standardized edit distance NED is calculated for each matching string registered in the knowledge database 4. Note that the standardized edit distance NED may be calculated for all matching strings registered in the knowledge database 4, or may be calculated for some of the matching strings. Next, the minimum value NED from the one or more calculated standardized edit distances NED is calculated. MIN Then, calculate the minimum value NED from 1. MINThe value obtained by subtracting the above can be obtained as the likelihood [j+k,j]. In other words, the likelihood represents the degree of match between two strings when the most similar string is selected from among the matching strings registered in the knowledge database 4 for the concatenated string. When the degree of match between two strings is high, the number of times the string is transformed is small, and the standardized edit distance is small. Therefore, when the degree of match between the concatenated string obtained by concatenating the strings in the ruled box from the jth column to the (j+k)th column and the matching string registered in the knowledge database 4 as the item value belonging to the jth item name (i.e., the jth column) is high, the likelihood [j+k,j] indicates a high value (i.e., a value close to 1), and when the degree of match is low, the likelihood [j+k,j] indicates a low value (i.e., a value close to 0).
[0038] The likelihood may be calculated based on the output of a trained model trained in the knowledge database 4 using a known machine learning method such as DNN (Deep Neural Network). The trained model can be created from character string data obtained from a large amount of tabular documents. Specifically, a large amount of character string data is used, a plurality of character strings are randomly extracted from the large amount of character string data, and the character strings are concatenated to generate a concatenated character string. Next, the likelihood (for example, standardized edit distance) between the input character string data, which is the generated concatenated character string, and the matching character string registered in the knowledge database 4 is calculated. Next, the likelihood corresponding to each input character string data is assigned as a correct answer label (or ranking) and used as training data. Then, the trained model can be created by machine learning using the input character string data and the training data so that the estimated likelihood, which is the output of the trained model, matches the correct answer label. Since the estimated likelihood is output by inputting the concatenated character string into the trained model, the likelihood can be directly calculated without referring to the knowledge database 4 or without using the knowledge database 4. This is particularly effective when there is a large number of matching strings registered in the knowledge database 4, and it reduces the amount of calculation required to refer to the knowledge database 4 and the amount of memory required to store the matching strings in the knowledge database 4.
[0039] In step S310, to compare the concatenated string obtained in step S309 with another concatenated string obtained by concatenating a string in a ruled box adjacent to the concatenated string, the ruled boxes from the jth column to the (j+k+1)th column are integrated, and the strings in the ruled boxes are concatenated to obtain a concatenated string. Then, similar to the process in step S309, the knowledge database 4 is referenced to calculate the likelihood [j+k+1,j] that the concatenated string belongs to the jth item name, and the likelihood L[j+k+1,j] is substituted for variable L2 (step S310).
[0040] In step S311, it is confirmed whether the value of variable L1 is equal to or less than the value of variable L2 (step S311). If the value of variable L1 is equal to or less than the value of variable L2 (Yes in step S311), the likelihood of concatenating another string to the concatenated string obtained in step S309 is higher than the likelihood of the concatenated string, so the process proceeds to step S312. If the value of L1 is greater than the value of L2 (No in step S311), the process proceeds to step S313.
[0041] In step S312, 1 is added to the variable k (step S312), and the process proceeds to step S307.
[0042] In step S313, it is confirmed whether the likelihood L[j+k,j] calculated in step S309 is equal to or greater than a predetermined threshold T1 (step S313). If the likelihood L[j+kj] is equal to or greater than the predetermined threshold T1 (Yes in step S313), the process proceeds to step S314. If the likelihood [j+k,j] is less than the predetermined threshold T1 (No in step S313), the process proceeds to step S315. Here, the predetermined threshold T1 is a threshold for suppressing (cutting off) an excessive increase in the number of ruled frame integration candidates C[j]. For example, the predetermined threshold T1 can be preset to 0.5, but is not limited to this value.
[0043] In step S314, a concatenated string obtained by concatenating the strings in the ruled frame from the jth column to the (j+k)th column, and the row number and column number of each ruled frame are stored, for example, in a memory MEM (not shown) as a candidate for merging the ruled frame C[j] (step S314).
[0044] In step S315, 1 is added to the variable j (step S315), and the process proceeds to step S304.
[0045] In step S316, the memory MEM is referred to, and it is confirmed whether or not there is an overlap in the ruled line frames to be integrated for the ruled line frame integration candidate C[j]. For example, when j=1 and the ruled line frames of the first and second columns are the ruled line frame integration candidate C[j], and when j=2 and the ruled line frames of the second and third columns are the ruled line frame integration candidate C[j], the ruled line frame of the second column overlaps, so it is determined that there is an overlap in the ruled line frames to be integrated. If there is an overlap in the ruled line frames to be integrated (Yes in step S316), the process proceeds to step S317. If there is no overlap in the ruled line frames to be integrated (No in step S316), the process proceeds to step S318. In step S316, it is determined whether or not there is a character recognition error in the character string to be concatenated, and if it is determined that there is a character recognition error, the character string to be concatenated may be replaced with a matching character string with the highest degree of match from among the item values registered in the table knowledge database 4.
[0046] In step S317, among the combination candidates C[j] of overlapping ruled frames, candidates whose likelihood of belonging to the item name of the overlapping combination candidate is smaller than a predetermined threshold T1 are discarded from the memory MEM (step S317). As a method of rejection, for example, a predetermined number of candidates may be left in descending order of likelihood.
[0047] In step S318, 1 is added to the variable i (step S318), and the process proceeds to step S302. It is not necessary to perform the series of processes from step S302 to step S318 on all the ruled frames of the table-format document. For example, if it is clear during the process that all the contents of the subsequent ruled frames are blank, or if the user determines that it is not necessary to combine the ruled frames, the series of processes described above may be stopped.
[0048] FIG. 7 is a diagram for explaining an example of the operation of the table recognition device of the first embodiment. FIG. 7(a) is an example of a table format document to be recognized. In the table format document shown in FIG. 7(a), "Total Fat" is written as an item value belonging to the item name "Item A", "Saturated Fat" is written as an item value belonging to the item name "Item B", and "25g" and "9g" are written as item values belonging to the item name "Item C". FIG. 7(b) is an example of a table structure recognition result for FIG. 7(a). FIG. 7(c) is an example of a character recognition result for FIG. 7(b). FIG. 7(d) is an example of a character string recognition result obtained by integrating the ruled frame judgment for FIG. 7(c). For the sake of simplicity, it is assumed that the table positions of the item names "Item A", "Item B", and "Item C" are known, and that the character recognition of each item name has been performed correctly. Hereinafter, a description of the processing of the ruled line frame integration determination unit 3 for the line (first line) of the item names in FIG. 7 will be omitted, and the second line, which is the top line of the item values, will be considered as the new first line.
[0049] In the example of FIG. 7, first, the table structure recognition unit 1 recognizes each of the ruled lines 501 to 509.
[0050] Next, character recognition unit 2 recognizes character strings within each of the regions from ruled box 501 to ruled box 509. Then, character strings 510 to 517 are obtained as the character recognition results.
[0051] Here, the item value "Total Fat" belonging to the item name "Item A" exceeds the ruled frame in the second row and first column, and extends into the adjacent ruled frame in the second row and second column. Therefore, the character recognition result at this point is divided into character string 513 ("Total F") and character string 514 ("at"). In other words, character string 513 ("Total F") is recognized as the character string in ruled frame 504 belonging to the item name "Item A". Furthermore, character string 514 ("at") is erroneously recognized as the character string in ruled frame 505 belonging to the item name "Item B". Also, the item value "Saturated Fat" belonging to the item name "Item B" is within the ruled frame 508, but the initial "S" touches the vertical rule. As a result, a character recognition error occurs due to the influence of the vertical rule, and the "S" changes to a "6." Therefore, the character recognition result at this point is erroneously recognized as the character string 516 ("6oturated Fat"). Furthermore, because the item value "9g" belonging to the item name "Item C" is entered left-justified, it is also necessary to determine whether the item values "6aturated Fat" and "9g" are a continuous character string.
[0052] Next, the ruled line frame integration judgment unit 3 refers to matching strings (i.e., strings that should be written as item values) registered in the knowledge database 4, and judges which ruled line frames should be integrated based on the likelihood that the item value in each ruled line frame (i.e., strings obtained by character recognition) belongs to the item name (i.e., the minimum standardized edit distance minus 1). In other words, it judges whether the string in each ruled line frame should be concatenated with the strings in the adjacent left and right ruled line frames. Then, based on the judgment result, the strings in the ruled line frames are concatenated, and either the concatenated string, which is the concatenated string, or the single string, which is the single string that is not concatenated, is output as an integrated string, which is both the final integration judgment result and the recognition result.
[0053] A specific operation of the ruled line frame integration judgment unit 3 will be described with reference to the process shown in the flowchart of Fig. 6. First, consider a case where, in the first row (i=1) of the item value of the table, ruled line frame 504 (i.e., character string 513 ("Total F")), ruled line frame 505 (i.e., character string 514 ("at")), ruled line frame 506 (i.e., character string 515 "25g"), and a matching character string registered in knowledge database 4 are evaluated. For simplicity, we will only describe the cases of the item value "Total Fat" belonging to the item name "Item A" in knowledge database 4, the item value "Trans Fat" belonging to the item name "Item B", and "[*NUM*]g" belonging to the item name "Item C".
[0054] First, when variable i=1 and variable j=1, it is determined whether j is equal to or less than the number of items (step S304). Since the number of items in the second row is 3, j is equal to or less than the number of items (Yes in step S304), and it is determined whether a character recognition result is present in the ruled frame in the j-th column (step S305). When variable i=1 and variable j=1, character string 513 is present in the ruled frame in the j-th column (i.e., ruled frame 504) (Yes in step S305), so 0 is substituted for variable k (step S306). In step S307, since the number of items in the second row is 3, the value obtained by subtracting (j+1) from the number of items is greater than k (=0) (Yes in step S307), and the process proceeds to step S308. Next, it is determined whether there is a character recognition result within the ruled line frame in the (j + k)-th column (step S308). Since there is a character string 513 in the ruled line frame in the (j + k)-th column (where k = 0, that is, the ruled line frame 504) (Yes in step S308), a variable L1 is calculated (step S309), and a variable L2 is calculated (step S310). Here, the variable L1 is the likelihood between the character string 513 "Total F" within the ruled line frame 504 and the item value "Total Fat" belonging to the item name "Item A" in the knowledge database 4, and it can be calculated from the normalized edit distance NED between the character string 513 "Total F" and the matching character string "Total Fat". Also, the variable L2 is the likelihood between the concatenated character string "Total Fat" obtained by concatenating the ruled line frame 504 and the ruled line frame 505 and the item value "Total Fat" belonging to the item name "Item A" in the knowledge database 4, and it can be calculated from the normalized edit distance NED between the concatenated character string "Total Fat" and the matching character string "Total Fat". Subsequently, the variable L1 and the variable L2 are compared (step S311). Here, in the calculation of the normalized edit distance NED, when converting the character string "Total F" to the item value "Total Fat", 2 character substitutions are required. The length of the character string of "Total Fat", including whitespace characters, is 9. Therefore, the variable L1 is 1 - (2 / 9) = 0.788. On the other hand, when converting the concatenated character string "Total Fat" to the item value "Total Fat", there is no substitution (that is, 0 character substitutions). Therefore, the variable L2 is 1 - (0 / 9) = 1.0. As a result of comparing the variable L1 and the variable L2, L1 < L2 (Yes in step S311), and 1 is added to the variable k (step S312). Then, the process returns to step S307.
[0055] In step S307, since the number of items in the second row is 3, the value obtained by subtracting (j + 1) from the number of items is equal to k (= 1) (Yes in step S307), so the process proceeds to step S308. As in the above, it is determined whether the character recognition result is present in the ruled frame in the (j+k)th column (step S308). Since the character string 514 "at" exists in the ruled frame in the (j+k)th column (i.e., ruled frame 505) (Yes in step S305), variable L1 is calculated (step S309), and variable L2 is calculated (step S310). Here, variable L1 is the likelihood between "Total Fat", which is the concatenated character string obtained by concatenating ruled frames 504 and 505, and the item value "Total Fat" belonging to the item name "Item A" in knowledge database 4, and can be calculated from the standardized edit distance NED. Moreover, variable L2 is the likelihood between "Total Fat 25g", which is a concatenated character string obtained by concatenating ruled frame 504, ruled frame 505, and ruled frame 506, and item value "Total Fat" belonging to item name "Item B" in knowledge database 4, and can be calculated from the standardized edit distance NED. Next, variable L1 and variable L2 are compared (step S311). Here, in calculating the standardized edit distance NED, when converting the concatenated string "Total Fat" to the item value "Total Fat", no replacement is performed (i.e., 0 characters are replaced). Therefore, variable L1 is 1-(0 / 9)=1.0. On the other hand, when converting the concatenated string "Total Fat 25g" to the item value "Total Fat", 4 characters must be replaced. Therefore, variable L2 is 1-4 / 9=0.556. As a result of comparing variables L1 and L2, L1>L2 is satisfied (No in step S311), and the process proceeds to step S313. In step S313, since the previously calculated variable L1 is greater than a predetermined threshold T1=0.5 (Yes in step S313), ruled line frames 504 and 505 become the ruled line frame integration candidate C[j] (step S314). Then, 1 is added to variable j (step S315), and the process returns to the beginning of step S304.
[0056] Next, when variable i=1 and variable j=2, it is determined whether j is equal to or less than the number of items (step S304). Since the number of items in the second row is 3, j is equal to or less than the number of items (Yes in step S304), and it is determined whether a character recognition result is present in the ruled frame in the jth column (step S305). When variable i=1 and variable j=2, character string 514 is present in the ruled frame in the jth column (i.e., ruled frame 505) (Yes in step S305), and 0 is substituted for variable k (step S306). In step S307, since the number of items in the second row is 3, the value obtained by subtracting (j+1) from the number of items is greater than k (=0) (Yes in step S307), and the process proceeds to step S308. Next, it is determined whether the character recognition result is present in the ruled box in the (j+k)th column (step S308). Since the character string 413 is present in the ruled box in the (j+k)th column (k=0, i.e., the ruled box 505) (Yes in step S308), the variable L1 is calculated (step S309), and the variable L2 is calculated (step S310). Here, the variable L1 is the likelihood between the character string 514 "at" in the ruled box 505 and "Trans Fat" belonging to the item name "Item B" in the knowledge database 4, and can be calculated from the standardized edit distance NED. The variable L2 is the likelihood between the concatenated character string "at 25g" obtained by concatenating the character string in the ruled box 505 and the character string in the ruled box 506, and the item value "Trans Fat" belonging to the item name "Item B" in the knowledge database 4, and can be calculated from the standardized edit distance NED. Next, the variables L1 and L2 are compared (step S311). Here, in calculating the standardized edit distance NED, when converting the character string "at" to the item value "Trans Fat", 7 characters need to be replaced. The length of the character string "Trans Fat", including blank characters, is 9. Therefore, the variable L1 is 1-(7 / 9)=0.222. On the other hand, when converting the concatenated character string "at 25g" to the item value "Trans Fat", 11 characters need to be replaced. Therefore, the variable L2 is 1-11 / 9=0.0 (if 0 or less, it is limited to 0). As a result of comparing the variables L1 and L2, L1>L2 (No in step S311), and the process proceeds to step S313. In step S313, since the previously calculated variable L1 is smaller than the predetermined threshold T1 = 0.5 (No in step S313), it is not a candidate for merging the ruled line frame C[j], so the process proceeds to step S315, where 1 is added to the variable j (step S315), and the process returns to the beginning of step S304.
[0057] Finally, when variable i=1 and variable j=3, it is determined whether j is equal to or less than the number of items (step S304). Since the number of items in the second row is 3, j is equal to or less than the number of items (Yes in step S304), and it is determined whether a character recognition result is present in the ruled frame in the jth column (step S305). When variable i=1 and variable j=3, character string 514 is present in the ruled frame in the jth column (i.e., ruled frame 506) (Yes in step S305), so 0 is substituted for variable k (step S306). In step S307, since the number of items in the second row is 3, the value obtained by subtracting (j+1) from the number of items is less than k (=0) (No in step S307), and the process proceeds to step S313. In step S313, a variable L1 is calculated. Here, the variable L1 is the likelihood between the character string 515 “25g” in the ruled frame 506 and the item name "[*NUM*]g" belonging to the item name “Item C” in the knowledge database 4, and can be calculated from the standardized edit distance NED. Here, when converting the character string "25g" to the item value "[*NUM*]g" in the calculation of the standardized edit distance NED, no replacement is performed because [*NUM*] is a wildcard and can take any numeric value. Therefore, the variable L1 is 1.0, which is greater than the predetermined threshold T1=0.5 (Yes in step S313), and the unintegrated single ruled line frame 506 becomes the ruled line frame integration candidate C[j] (step S314).
[0058] As described above, all ruled line frames belonging to the first row (variable i=1) of the item names in the table are evaluated, and the pair of ruled line frames 504 and 505, and single ruled line frame 505 are obtained as candidates for ruled line frame integration C[j]. Then, in step S316, it is determined whether or not there is any overlap in the ruled line frames to be integrated. Since there is no overlap in the ruled line frames to be integrated (No in step S316), the character strings recognized after being split into character string 513 "Total F" and character string 514 "at" are concatenated into a single character string as the concatenated character string "Total Fat".
[0059] Next, in step S316, it is determined using the likelihood whether there is a character recognition error in the concatenated string or the individual string. Since the likelihood of the concatenated string obtained by concatenating the string 513 "Total F" and the string 514 "at" is 1.0 (i.e., a perfect match with the string that should be entered in the item value), the concatenated string is determined to have been recognized correctly, and the string 521 ("Total Fat") is output as an integrated string that is both the final integrated judgment result and the recognition result. Furthermore, the string 515 is treated as an individual string that is a single string that is not concatenated. Since the likelihood in this case is 1.0, like the strings 513 and 514, the string 515 is determined to have been recognized correctly, and the string 522 ("25g") is output as an integrated string that is both the final integrated judgment result and the recognition result.
[0060] Next, consider the case where, in the second row (i=2) of the item values in the table, line box 508 (i.e., character string 516 ("6aturated Fat")), line box 509 (i.e., character string 517 ("9g")), and matching character strings registered in knowledge database 4 are evaluated. For simplicity, only the case of the item value "Saturated Fat" belonging to the item "Item B" in the knowledge database 4 and the item value "[*NUM*]g" belonging to the item name "Item C" will be described.
[0061] First, when variable i=2 and variable j=1, it is determined whether j is equal to or less than the number of items (step S304). Since the number of items in the third row is 3, j is equal to or less than the number of items (Yes in step S304), and it is determined whether a character recognition result is present within the ruled frame in the jth column (step S305). When variable i=2 and variable j=1, no character string is present in the ruled frame in the jth column (i.e., ruled frame 507) (No in step S305), so 1 is added to variable j (step S315), and the process returns to the beginning of step S304. Next, when variable i=2 and variable j=2, it is determined whether j is equal to or less than the number of items (step S304). Since the number of items in the third row is 3, j is equal to or less than the number of items (Yes in step S304), and it is determined whether a character recognition result is present in the ruled frame in the j-th column (step S305). When variable i=2 and variable j=2, character string 516 is present in the ruled frame in the j-th column (i.e., ruled frame 508) (Yes in step S305), and 0 is substituted for variable k (step S306). In step S307, since the number of items in the third row is 3, the value obtained by subtracting (j+1) from the number of items is equal to k (=0) (Yes in step S307), and the process proceeds to step S308. Next, it is determined whether the character recognition result is present in the ruled box in the (j+k)th column (step S308). Since the character string 516 is present in the ruled box in the (j+k)th column (k=0, i.e., the ruled box 508) (Yes in step S308), a variable L1 is calculated (step S309), and a variable L2 is calculated (step S310). Here, the variable L1 is the likelihood between the character string 516 "6aturated Fat" in the ruled box 508 and the item value "Saturated Fat" belonging to the item name "Item B" in the knowledge database 4, and can be calculated from the standardized edit distance NED. Moreover, the variable L2 is the likelihood between the concatenated character string "6aturated Fat9g" obtained by concatenating the character string in the ruled box 508 and the character string in the ruled box 509, and the item value "Saturated Fat" belonging to the item name "Item B" in the knowledge database 4, and can be calculated from the standardized edit distance NED. Next, the variables L1 and L2 are compared (step S311). Here, in calculating the standardized edit distance NED, when converting the character string "6aturated Fat" to the item value "Saturated Fat", one character needs to be replaced. The length of the character string "Saturated Fat", including the space character, is 13. Therefore, the variable L1 is 1-(1 / 13)=0.923. On the other hand, when converting the concatenated character string "6aturated Fat9g" to the item value "Saturated Fat", three characters need to be replaced. The length of the character string "6aturated Fat9g", including the space character, is 15. Therefore, the variable L2 is 1-3 / 15=0.8. As a result of comparing the variables L1 and L2, L1>L2 (No in step S311), and the process proceeds to step S313. In step S313, the previously calculated variable L1 is greater than a predetermined threshold T1=0.5 (Yes in step S313), so that the unmerged single ruled line frame 508 becomes the ruled line frame merger candidate C[j] (step S314). Then, 1 is added to the variable j (step S315), and the process returns to the beginning of step S304.
[0062] Finally, when variable i=2 and variable j=3, it is determined whether j is equal to or less than the number of items (step S304). Since the number of items in the third row is 3, j is equal to or less than the number of items (Yes in step S304), and it is determined whether a character recognition result is present in the ruled frame in the jth column (step S305). When variable i=2 and variable j=3, character string 517 is present in the ruled frame in the jth column (i.e., ruled frame 509) (Yes in step S305), so 0 is substituted for variable k (step S306). In step S307, since the number of items in the third row is 3, the value obtained by subtracting (j+1) from the number of items is less than k (=0) (No in step S307), so the process proceeds to step S313. In step S313, a variable L1 is calculated. Here, the variable L1 is the likelihood between the character string 517 “9g” in the ruled frame 509 and the item name "[*NUM*]g" belonging to the item name “Item C” in the knowledge database 4, and can be calculated from the standardized edit distance NED. Here, when converting the character string "9g" to the item value "[*NUM*]g" in the calculation of the standardized edit distance NED, [*NUM*] is a wildcard and any numerical value can be entered, so no replacement is performed. Therefore, the variable L1 is 1.0, which is greater than the predetermined threshold T1=0.5 (Yes in step S313), so the unintegrated single ruled line frame 509 becomes the ruled line frame integration candidate C[j] (step S314).
[0063] As described above, all ruled line frames belonging to the second row (variable i=2) of the table item values have been evaluated, and single ruled line frames 508 and 509 have been obtained as ruled line frame merging candidates C[j]. Then, in step S316, it is determined whether the ruled line frames to be merged include overlaps. Since there are no overlaps in the ruled line frames to be merged (No in step S316), character string 516 in ruled line frame 508 and character string 517 in ruled line frame 509 are each treated as a single, unlinked character string.
[0064] Next, in step S313, it is determined whether there is a character recognition error in the concatenated character string or the single character string using the likelihood. The likelihood of character string 516 is 0.923, that is, it is not an exact match with the character string that should be written in the item value, so the value of the likelihood is compared with a predetermined threshold T2 for error determination. At this time, the predetermined threshold T2 for error determination is preferably, for example, 0.7, which can be set in advance. Since the value of the likelihood of character string 516 (0.923) is equal to or greater than the predetermined threshold T2 (0.7) for error determination, it is estimated that this character string contains an error. Therefore, as a replacement for character string 516, character string 523 is replaced with the character string "Saturated Fat", which has the highest likelihood among the matching character strings registered in knowledge database 4. Then, character string 523 is output as an integrated character string, which is the final integrated judgment result and the recognition result. On the other hand, since the likelihood of character string 517 is 1.0, character string 517 is determined to have been correctly recognized, and character string 524 ("9g") is output as an integrated character string which is both the final integrated judgment result and the recognition result. Even if the likelihood of the concatenated string or the single string is 1.0 (i.e., an exact match), the concatenated string or the single string may be replaced with the string with the highest likelihood among the matching strings registered in the knowledge database 4. This is because the replacement will result in the same string. In other words, if the likelihood is equal to or greater than a predetermined threshold T2 for error determination, including the case where the likelihood is 1.0, the string may be replaced with the string with the highest likelihood among the matching strings registered in the knowledge database 4. In other words, if the likelihood is equal to or greater than a predetermined threshold T2 for error determination, the string may be replaced with the matching string registered in the knowledge database 4 that was used to calculate the likelihood.
[0065] If the likelihood of the concatenated character string is less than a predetermined threshold T2 (e.g., 0.7) for determining an error, it may be that, for example, the character string itself is correctly recognized, but the degree of match with the matching character string registered in the knowledge database 4 is low. In that case, the concatenated character string or the single character string may be output as it is, without being replaced with the matching character string registered in the knowledge database 4.
[0066] The above process is performed for all ruled lines, and character strings 518 to 524 are obtained as integrated character strings obtained from the final integration decision for the ruled lines.
[0067] In the first embodiment, the specific operation example of the table recognition device has been described only for the ruled frames belonging to the item values of a tabular document, but the present invention is not limited to this. For example, it is possible to recognize item names in the same way as item values. In this case, for example, matching character strings related to item names can be registered in the knowledge database 4, and the same processing can be performed on the ruled frames belonging to the item names as on the ruled frames belonging to the item values.
[0068] As described above, the ruled line frame integration determination unit 3 does not use the ruled line frame information of adjacent ruled line frames in the integration determination of the ruled line frames. Therefore, it is possible to correctly integrate the ruled line frames without relying on the ruled line frame information.
[0069] Furthermore, the ruled line frame integration judgment unit 3 refers to the matching character strings registered in the knowledge database 4, and judges that the concatenated character string should be concatenated if it is not a meaningless string of character strings but is highly likely to be meaningful (i.e., if it is judged to have a high likelihood and be close to the item name or item value). Therefore, it is possible to integrate ruled lines even if there is an error in part of the item name or item value (for example, a character recognition error, a typo, partial omission of the written content, etc.). Furthermore, since it can be replaced with a character string that is close to the matching character string registered in the knowledge database 4, the correct character string can be output.
[0070] The table recognition device described above in detail in embodiment 1 calculates the likelihood as the degree of match belonging to the item of the character recognition result within each frame line, and determines which character strings should be concatenated based on the calculated likelihood. Therefore, a character string written across a plurality of ruled frames can be accurately recognized without relying on ruled frame information.
[0071] The table recognition device described in detail in the first embodiment is adapted to refer to matching character strings registered in a knowledge database, and to determine that a concatenated character string should be concatenated if it is highly likely that the concatenated character string will make sense. Furthermore, the concatenated character string is replaced with a character string that is close to the matching character string registered in the knowledge database. Therefore, even if there is an error in character recognition in the item name or in the item name, not only can character strings be concatenated accurately, but also errors in the character recognition results can be corrected at the same time, providing a synergistic effect.
[0072] Embodiment 2 In the above-mentioned embodiment 1, a knowledge database is used for the ruled frame integration judgment, but this is not limited to this. For example, in the ruled frame integration judgment, information on table structure constraints, which is information that restricts the compatible character strings that can be written as an integrated character string, can also be used. This configuration will be described as embodiment 2.
[0073] Fig. 8 is a functional configuration diagram showing the configuration of a table recognition device 100 in embodiment 2. A new component compared to Fig. 1 is a table structure knowledge database 5. The other components and operations are the same as those in Fig. 1, and the description will be omitted.
[0074] The table structure knowledge database 5 stores information on table structure constraints, which is information that restricts a matching character string that can be written in a ruled frame as an integrated character string. For example, the information on table structure constraints is information that restricts a matching character string that can be written in a ruled frame as an integrated character string from among a plurality of matching character strings defined in the knowledge database 4 based on character string information in the surrounding ruled frames. More specifically, for example, the information on table structure constraints is information that indicates a relationship between items in a table when the items are classified into major items, medium items, and minor items. For example, the table structure knowledge database 5 may register matching character strings that can be written as item values belonging to item names in a similar manner to the knowledge database 4. FIG. 9 is an example of the table structure knowledge database 5. As information on the table structure constraints shown in FIG. 9, a matching character string (called a constraint character string) belonging to the item name "Item A" is registered in the left column. Also, in the right column, when a matching character string (i.e., a constrained character string) for the item name "Item A" is written, a matching character string (called a writable character string) that can be written for the adjacent item name "Item B" is registered. Note that in the table structure knowledge database 5, the character string of a matching character string is not limited to one word, and may be multiple words, phrases, or sentences.
[0075] The ruled line frame integration determination unit 3 refers to the knowledge database 4, the table structure knowledge database 5, and the ruled line frame integration candidates C[j] stored in a memory MEM (not shown), and limits the multiple matching character strings to one or more matching character strings using information on the constraints of the table structure. It then calculates the degree of match between the limited one or more matching character strings and the character string recognized by the character recognition unit 2, and determines which ruled line frames should be integrated depending on the degree of match. In this second embodiment, for example, the ruled line frame integration judgment unit 3 refers to the table structure knowledge database 5, and when the ruled line frame integration candidate C[j] corresponds to an item value (constrained string) belonging to a specified item name, the unit 3 restricts the item value candidates (i.e., integrated strings) belonging to other item names adjacent to the specified item name in the knowledge database 4 to one or more matching strings by restricting them to descriptive strings.
[0076] Fig. 10 is a flow chart showing the operation sequence of the ruled line integration judgment unit 3 in the embodiment 2. In Fig. 10, the steps different from Fig. 6 are step S309A and step S310A. Steps with the same numbers as in Fig. 6 perform the same processing as shown in the embodiment 1, and therefore the explanation will be omitted.
[0077] In step S309A, the ruled boxes from the jth column to the (j+k)th column are merged, and the character strings in the ruled boxes are concatenated to obtain a concatenated character string. Then, by referring to the table constraint information database 5 and the ruled box merging candidate C[j-1] stored in the memory MEM, it is determined whether the ruled box merging candidate C[j-1], which is a concatenated character string adjacent to the obtained concatenated character string, is a constrained character string for the obtained concatenated character string (step S309A). If the ruled frame integration candidate C[j-1] corresponds to the restricted string, the matching string belonging to the jth (i.e., jth column) item name in the knowledge database 4 is restricted to the describable strings listed in the table structure knowledge database 5. Then, the likelihood [j+k,j] that the concatenated string belongs to the item name in the jth column is calculated, and the likelihood L[j+k,j] is substituted for the variable L1. If the ruled frame integration candidate C[j-1] does not correspond to the restricted string, no restriction is performed using the table structure knowledge database 5, and the likelihood [j+k,j] that the concatenated string belongs to the item name in the jth column is calculated, and the likelihood L[j+k,j] is substituted for the variable L1 (step S309A).
[0078] In step S310A, the ruled frames from the jth column to the (j+k+1)th column are merged, and the character strings in the ruled frames are concatenated to obtain a concatenated character string. Then, similar to the process in step S309A, the table constraint information database 5 and the ruled frame merging candidate C[j-1] stored in the memory MEM are referenced to determine whether the ruled frame merging candidate C[j-1], which is a concatenated character string adjacent to the obtained concatenated character string, is a constrained character string for the obtained concatenated character string (step S310A). If the ruled frame integration candidate C[j-1] corresponds to the restricted string, the matching string belonging to the jth item name (i.e., the jth column) in the knowledge database 4 is restricted to the describable strings listed in the table structure knowledge database 5. Then, the likelihood [j+k+1,j] that the concatenated string belongs to the jth item name is calculated, and the likelihood L[j+k+1,j] is substituted for the variable L2. If the ruled frame integration candidate C[j-1] does not correspond to the restricted string, no restriction is performed using the table structure knowledge database 5, and the likelihood [j+k+1,j] that the concatenated string belongs to the jth item name is calculated, and the likelihood L[j+k+1,j] is substituted for the variable L2 (step S310A).
[0079] A specific example of the operation of the table recognition device of the second embodiment will be described below using the table structure knowledge database 5 shown in FIG. 9 for the table shown in FIG.
[0080] The ruled line box integration judgment unit 3 refers to a table structure knowledge database 5 and imposes restrictions on a knowledge database 4 used when calculating the likelihood that the character recognition results within each ruled line box belong to an item. Specifically, when character string 521 ("Total Fat") is obtained as an item value belonging to the item name "Item A" in FIG. 7(d), by referring to table structure knowledge database 5 in FIG. 9, the candidates for possible character strings for the item value belonging to the adjacent item name "Item B" are restricted to "Saturated Fat" or "Trans Fat."
[0081] By restricting the integrated strings, which are candidates for item values belonging to adjacent item names, to compatible strings that can be written, the candidates for ruled frame integration can be limited to more accurate strings, and the accuracy of the ruled frame integration determination can be improved. Furthermore, the number of candidates for ruled frame integration can be reduced, and the amount of processing required for likelihood calculation can be reduced.
[0082] The table recognition device described above in detail in embodiment 2 limits the number of matching character strings to one or more in the ruled frame integration determination by using table structure constraint information, which is information that restricts the matching character strings that can be written as an integrated character string, thereby improving the accuracy of the ruled frame integration determination.
[0083] Embodiment 3 In the integrated judgment of the ruled line frames, the judgment can be made taking into consideration the possibility that characters adjacent to the ruled lines have been erroneously recognized. This configuration will be described as the third embodiment.
[0084] When calculating the likelihood that a character string from a recognition result belongs to a certain item, the ruled line frame integration judgment 3 "weights" each character to reduce the influence of erroneous recognition of characters close to ruled lines. For example, when using the standardized edit distance as the likelihood, in the cost calculation of character conversion such as insertion, deletion, and replacement when calculating the standardized edit distance, the cost value for character conversion of characters close to a ruled line can be weighted lightly. The weighting value of the cost value is preferably, for example, 0.5, compared to the usual 1, but is not limited to this. For example, the weighting value of the cost value can be appropriately changed depending on the type of the ruled line, etc. By weighting characters close to ruled lines so as to reduce the cost of character conversion, the effect of erroneous recognition of characters close to ruled lines can be suppressed, or in other words, erroneous recognition of characters close to ruled lines can be tolerated.
[0085] Regarding whether or not a character is close to a ruled line, for example, if the character touches the ruled line, the character is determined to be close to the ruled line. Even if the character is not touching the ruled line, for example, the distance from the ruled line to the character may be used for the determination. In this case, if the distance from the ruled line to the character is closer than a predetermined threshold, the character is determined to be close to the ruled line. The threshold value for the distance from the ruled line to the character can be set in advance to a value corresponding to, for example, the thickness of the ruled line, the size of the character, and the like. Specifically, the distance three times the thickness of the ruled line can be set as the threshold value for the distance from the ruled line to the character. Furthermore, the number of characters determined to be close in a character string within one ruled line frame is not limited to one character. For example, in a three-character character string "ABC," if the distances from the ruled line to the characters "B" and "C" are closer than a predetermined threshold, the characters "B" and "C" are determined to be close to the ruled line. In other words, both the characters "B" and "C" can be subject to weighting of the cost value.
[0086] FIG. 11 is a specific example of the operation of the table recognition device of the third embodiment. FIG. 11(a) is an example of a table to be recognized. The table shown in FIG. 11(a) has "Total Fat" as an item value belonging to the item name "Item A" and "25g" as an item value belonging to the item name "Item C". FIG. 11(b) is an example of the table structure recognition result for FIG. 11(a). FIG. 11(c) is an example of the character recognition result for FIG. 11(b). FIG. 11(d) is an example of the character string recognition result obtained by integrating the ruled frame judgment for FIG. 11(c).
[0087] In the example of FIG. 11, first, the table structure recognition unit 1 recognizes each of the ruled lines 601 to 606.
[0088] Next, the character recognition unit 2 recognizes character strings 607 to 612 within each ruled frame. Here, as shown in Fig. 11(c) , in character string 610, the character "F" adjacent to the vertical double ruled line is mistakenly recognized as the character "P." Also, in character string 611, the character "a" adjacent to the vertical double ruled line is mistakenly recognized as the character "p."
[0089] Next, a specific operation of the ruled line frame integration determination unit 3 will be described. Consider the case where a concatenated string (i.e., "Total Ppt") obtained by concatenating ruled box 604 (i.e., character string 610 ("Total P")) and ruled box 605 (i.e., character string 611 ("pt")) is evaluated against matching strings registered in knowledge database 4. For simplicity of explanation, only the case of item value "Total Fat" belonging to item name "Item A" in knowledge database 4 will be described.
[0090] First, we will explain the case where the cost value of characters close to the ruled frame is not weighted. When converting the concatenated character string "Total Ppt" obtained by concatenation into "Total Fat", it is necessary to replace the two characters "Pp". Furthermore, the length of the character string "Total Fat" is 9, including the space character. Therefore, the likelihood is 1-(2 / 9)=0.778.
[0091] Next, a case will be described in which the weight of the cost value for character conversion of characters close to a ruled line is set to 0.5 in the likelihood calculation. In this case, the characters "P" and "p" are subject to weighting of the cost value. When the concatenated character string "Total Ppt" obtained by concatenation is converted to "Total Fat", the likelihood is 1-(0.5×2 / 9)=0.889.
[0092] As described above, the likelihood when the cost value is not weighted is 0.778, whereas the likelihood when the cost value is weighted is 0.889. In other words, the likelihood is higher than when the cost value is not weighted, and the possibility that a character string of another item name will be mistakenly adopted (as a correct character string) can be reduced. This makes it possible to further improve the accuracy of the ruled frame integration determination.
[0093] In the above example, the cost value is weighted small for characters close to vertical lines, but this is not limiting. For example, the same processing can be performed for characters close to horizontal lines, and the same effect as described above can be achieved.
[0094] As described above, in the table recognition device described in detail in the third embodiment, in the calculation of the likelihood in the ruled line frame integration determination unit, the cost value for character conversion of characters close to a ruled line is weighted lightly. This reduces the influence of characters that are more likely to be misrecognized than other characters, thereby further improving the accuracy of the ruled line frame integration determination.
[0095] In each of the above-mentioned embodiments, the likelihood is shown as an example of the degree of similarity between two character strings, but the present invention is not limited to this. For example, character strings may be expressed as vectors, and the cosine similarity between two character string vectors may be used as the degree of similarity. For example, when the cosine similarity is close to 1, the two character vectors are similar and the degree of similarity is high, whereas when the cosine similarity is close to 0, the two character vectors are not similar and the degree of similarity is low.
[0096] In each of the above-mentioned embodiments, the process of determining whether or not to merge ruled lines is not limited to languages that are written horizontally or left to right. For example, the table recognition device according to the above-mentioned embodiment can be applied to a table in which rows and columns are switched, such as a vertically written document. For example, the table recognition device according to the above-mentioned embodiment can be applied to a language in which writing starts from the right, such as Arabic.
[0097] In addition to the above, any configuration that can obtain similar functions and effects may be used. Furthermore, any component of the embodiment may be modified or omitted within the scope of the present disclosure. [Explanation of symbols]
[0098] 1 table structure recognition unit, 2 character recognition unit, 3 ruled line frame integration judgment unit, 4 knowledge database, 5 table structure knowledge database, 100 table recognition device, 101 processor, 102 memory, 103 external storage device, 104 input / output interface.
Claims
1. A table recognition device that recognizes character strings described in a table-formatted document from image information of the table-formatted document, a character recognition unit that recognizes character strings written within each of a plurality of ruled frames provided in the table format document; a single character string that is a character string recognized for a target ruled frame that is a target ruled frame among the plurality of ruled frame, and a concatenated character string that is a concatenation of a character string recognized for a ruled frame other than the target ruled frame and the single character string, a ruled line frame integration determination unit that determines the single character string or the concatenated character string that has a higher degree of match with a matching character string to be written in the table format document as an integrated character string that is a character string that belongs to the target ruled line frame. A table recognition device comprising:
2. When the degree of similarity of the single character string or the concatenated character string determined as the integrated character string is equal to or greater than a predetermined threshold, the ruled line frame integration determination unit replaces the integrated character string with the matching character string used to calculate the degree of similarity.
2. The table recognition apparatus according to claim 1,
3. The ruled frame integration determination unit calculates the degree of coincidence for one or more matching character strings limited by information that restricts matching character strings that can be written within the ruled frame from among a plurality of matching character strings defined for each ruled frame, and determines the integrated character string.
3. The table recognition device according to claim 1, wherein:
4. the ruled line frame integration determination unit calculates the degree of coincidence by weighting the cost of character conversion of characters adjacent to the ruled lines of the plurality of ruled line frames so as to be small.
3. The table recognition device according to claim 1, wherein:
5. A table recognition method for recognizing a character string described in a table-formatted document from image information of the table-formatted document, comprising the steps of: a character recognition unit that recognizes character strings written within each of a plurality of ruled frames provided in the table format document; a single character string that is a character string recognized for a target ruled line frame that is a target ruled line frame among the plurality of ruled line frames, and a concatenated character string that is a concatenation of a character string recognized for a ruled line frame other than the target ruled line frame and the single character string, A character string or a concatenated character string that has a higher degree of coincidence with the matching character string to be written in the table format document is determined as an integrated character string that belongs to the target ruled frame. A table recognition method comprising:
Citation Information
Patent Citations
Ruled line frame correction method, ruled line frame correction device, and ruled line frame correction program
JP2017097805A
Data extraction method, data extraction device, and program thereof
WO2014068770A1
