Field of the Invention
This invention disclosed herein relates to data processing systems for the analysis of characters outputted from an optical character reader (OCR).
Background of the Invention
Most alphabetic characters have highly differing misread propensities based upon the alphabetic upper or lower case in which they are printed on the document scanned by an OCR. This is readily evident from an examination of the significantly different geometry in most upper and lower case characters; for example, A, a; E, e; G, g; and so on. It has been discovered that the overall OCR post-processing error correction function is enhanced by a preprocessing step within that function to determine the upper or lower case print convention in which the alphabetic characters within a word were inscribed on the document scanned by the OCR. This preprocessing step enhances the accuracy and reliability of the total overall OCR post-processing error correction function.
The utility of the subject invention can be seen in its preprocessing role with respect to the error correction apparatus disclosed and claimed in the copending patent application entitled "Regional Context Maximum Likelihood OCR Error Correction Apparatus," Ser. No. 600,743, which was filed on July 30, 1975 as a continuation-in-part to Ser. No. 459,820, which was filed on Apr. 10, 1974. The system disclosed therein selects the correct form of a garbled input word misread by an OCR so as to change the number of characters in the word by character splitting or concatenation. Dictionary words are stored in the system. The vastly different alphabetic character confusion propensities dependent upon whether a given character inscription would be in upper or lower case print convention, emphasizes the important utility of the subject invention in its determination as to whether an alphabetic character field (i.e., word) output from an OCR is related to the scan of an upper case or a lower case field inscription on the document scanned.
Objects of the Invention
It is an object of the invention to process textual data output from an OCR in an improved manner.
It is another object of the invention to discriminate between alphabetic character fields (e.g., words) scanned by an OCR with respect to the upper/lower case print convention in which the alphabetic characters were inscribed on the document scanned by the OCR.
It is another object of the invention to discriminate between such alphabetic character fields without the need of a stored dictionary of permissible received messages.
Description of the Drawings
The foregoing and other objects, features, and advantages of the invention will be apparent from the following description of the preferred embodiments of the invention, as illustrated in the accompanying drawings.
FIG. 1 displays diagrammatically in block diagram fashion the alphabetic character upper/lower case print convention discriminating apparatus.
FIG. 2 is a detailed block diagram of one embodiment of the invention wherein a pair of character occurrence probability storage devices are sequentially accessed by the series of alphabetic characters outputted by the OCR.
FIG. 3 is a detailed block diagram of another embodiment of the invention wherein a read-only character occurrence probability storage apparatus is employed to provide the print convention index (PCI) value at its output for each alphabetic character outputted by the OCR.
FIG. 4 displays diagrammatically an operation of the embodiment in FIG. 3.
Summary of the Invention
A so-called print convention index (PCI) developed by the apparatus and through the method of the subject invention, is a decision function formulation for the purpose of implying upper or lower case character words. For purpose of such general OCR applications as mail designation reading and text processing, for example, there are the following three print conventions to be considered with respect to the PCI operation: i.e., (1) all characters within a word are upper case print convention; (2) all characters within a word are lower case characters; and (3) all characters within a word are lower case except for the first character in the word which is upper case print convention.
The discrimination between these three print conventions is not trivial because an OCR misread (including conflicts and rejects) tends to confuse alphabetic character upper and lower case print conventions as well as character identity. OCR conflicts and rejects normally contain no print convention case inference with respect to the character(s) scanned.
The alphabetic character upper/lower case decision is made on a per field (i.e., word) basis using the PCI formulation set forth in the following equation (1): ##EQU1## where k is the number of alphabetic characters in the field; ".alpha." is the alphabetic character that has been recognized in the nth position in the field of alphabetic characters; and n is an index which is incremented, with respect to the subject field, from right to left (i.e., n = 1 at the last, furthest-to-the-right character position in the field). Accordingly, and by way of example, in the field of characters "Smith"; "k" = 5; the characters S and h represent the left-to-right direction of characters; and "n=1" (see above) is associated with the character h.
An upper case print convention is implied if the PCI value in equation (1) is greater than 0, and a lower case print convention is implied if the PCI value is equal to or less than 0. This "+" and "-" type assignment is purely arbitrary relative to the operation of the invention.
The expression "P.sub.U (.alpha..sub.n)" in equation (1) is representative of the probability that the OCR recognition .alpha..sub.n resulted from the scan of an upper case alphabetic character. Correspondingly, the expression P.sub.L (.alpha..sub.n) in equation (1) is representative of the probability that the OCR recognition .alpha..sub.n resulted from the scan of a lower case alphabetic character. The complete set of .alpha.'s cover all alphabetic upper and lower case characters, and may include conflict recognition rejects as well as the general alphabetic character reject code.
The values for the P.sub.U (.alpha..sub.n) and P.sub.L (.alpha..sub.n) expressions are stored in logarithmic form for purpose of equation (1) after having been precomputed by the formulation in equations (2) and (3), respectively: ##EQU2## where "U(i)" is the 1-26 "i"th upper case alphabetic character; "L(i)" is the 1-26 ith lower case alphabetic character; P.sub.c [.alpha..sub.n .vertline.U(i)] is the confusion probability of U(i) being read as .alpha..sub.n ; P[U(i)] is the probability of U(i) occurring on the scanned document because of the language (e.g., English) of the word inscribed on the document scanned; P.sub.c [.alpha..sub.n .vertline.L(i)] is the confusion probability of L(i) being read as .alpha..sub.n ; and P[L(i)] is the probability of L(i) occurring in the scanned document because of the language in which the word scanned by the OCR is inscribed on the document.
Table I herein sets forth the frequency of occurrence of alphabetic character letters in the English language so that, for example, the frequency of occurrence of the character A is 7.81%; of the character M is 2.62%; of the character T is 9.02%; and so on through to character Z at a frequency of occurrence of 0.09%. The alphabetic upper and lower case occurrence rates P[U(i)] and P[L(i)], respectively, are derived by applying a 20/80 scaling rule for textual documents and a 70/30 scaling rule for postal documents, respectively, to the frequency data provided in Table I. Accordingly, the relative P[U(i)] value for an upper case character in a textual document is 20% of the frequency value in Table I, whereas the P[L(i)] value for a textual document lower case character is 80% of the Table I value. On the other hand, the values of P[U(i)] and P[L(i)] are 70% and 30%, respectively, of the Table I value for a given upper or lower case character, respectively, if the document scanned by the OCR is in a postal designation reading application. The scaling rules are essentially arbitrary in terms of the exact scaling rule values used, and are empirical from the standpoint of knowledge gained through experience that a great majority of postal designation characters are imprinted in the upper case, whereas a majority of textual document characters are imprinted in the lower case print convention.
Referring to Tables II through VII in the appendix hereto, the Y-axis data are representative of the upper and lower case alphabetic characters imprinted on the document scanned by the OCR, whereas the X-axis characters pertain to the OCR upper and lower case character output. Additionally, the X-axis includes three conflict recognition categories (see Tables VI and VII) which are denoted by the OCR in its output as " ", "?", and "#". Specifically, the conflict recognitions are:
1. i/1 -- The i and 1 recognition circuits within the OCR are both turned on; however, the character is more reminiscent of i than 1. In the confusion data, this is denoted by .
2. 1/i -- The 1 and i logics again are both turned on; however, the recognition is more reminiscent of 1 than i. In the confusion data, it is denoted by ?.
3. N/W -- A recognition is indeterminant; however, characterized by what is interpreted as a strong diagonal tendency. In the confusion data, this is denoted by # .
The reject character notation * indicates that the recognition was non-conclusive and no character identification could be made.
Referring again to Tables II through VII, and with reference to equation (1) hereinabove, the PCI for the alphabetic character outputted by the OCR as an upper case A (see X-axis A), for example, would be the difference between: (1) the sum of the respective A column decimal equivalent probability values, each multiplied by its frequency of occurrence, for the Y-axis A-Z rows; and (2) the sum of the respective A column decimal equivalent probability values, each multiplied by its frequency of occurrence, for the Y-axis a-z rows. If the PCI value so derived is greater than zero, the implication is that the character scanned is upper case; whereas if the PCI value is equal to, or less than, zero, the implication is a lower case character. If the running sum PCI for the several alphabetic characters (including conflicts and rejects) in a word is indicative of an upper case print convention, the entire word will be treated as upper case print convention. On the other hand, if the running sum PCI for all characters in a word is indicative of a lower case print convention, the left-most character (i.e., the first character in the field) is to be treated separately from the characters in the remainder of the field which of course are treated as lower case.
Discussion of the Preferred Embodiments
Referring to FIG. 1, a dual output OCR 10 is connected to a Bayesian Online Numeric Discriminant (BOND) of the type disclosed in Chaires et al. U.S. Pat. No. 3,839,702, which issued on Oct. 1, 1974. OCR 10 is connected to BOND 11 by the OCR alphabetic character output line 12 and the numeric character output line 13. It will be recognized by those skilled in the art that the BOND 11 is not necessary for the practice of the subject invention. The output of BOND 11 is effectively the alpha/numeric discrimination disclosed in the aforementioned Chaires et al. patent. The discrimination is such that the electrical signals pertaining to the series of alpha characters appear along BOND output line 14, whereas the signals pertaining to the series of numeric characters appear on BOND output line 15. A register 16 functions as a storage buffer for the series of alphabetic characters in a field. Under the direction of control 17, register 16 sequentially outputs a series of alphabetic characters to address a probability store 18 on a one-at-a-time character basis. Storage 18 contains both upper and lower case occurrence probability constituents of equation (1 ) herein for each alphabetic character outputted by OCR 10 through BOND 11. The effective values of both upper and lower case probabilities for a given character are outputted to register 19, and directed to logarithmic adder 21 which functionally calculates the sum of all of the upper case probabilities and all of the lower case probabilities for alphabetic characters in a given field in accordance with equation (1). The sum of these probabilities is determinative of the field or word PCI value discussed previously.
Gate 22 serves as a buffer storage for the numeric character field outputted on line 15 and the alphabetic character field outputted on line 14. Gate 22 also provides an appropriate signal to control 17 as to the position of characters and blanks in the alphabetic and numeric fields. Adder 21 outputs the upper and lower case print convention subtotals, to comparator 23 which compares the relative magnitudes of the subtotals in order to arrive at the PCI value. If, as stated herein previously, the PCI value is greater than zero, the signal on line 24 will cause an upper case print convention flag to be associated with the alphabetic characters in the field outputted as a series of alphabetic characters from BOND 11 along line 14 through gate 22 and onto output line 25. On the other hand, if the PCI value in comparator 23 is equal to, or less than, zero, the signal on line 24 will cause a lower case print convention flag to be associated with the alphabetic character field passing through gate 22 from line 14 to output line 25. It should be recognized that the "greater than" and "lesser than" zero designations for print convention are arbitrary in choice, and are not limitations of the invention. They do, however, represent "polarities" indicative of upper/lower case print conventions.
Referring to FIG. 2, dual output OCR 31 is connected to BOND 32 by OCR output lines 33 and 34. The BOND 32 is connected on its output side by lines 35 and 36 to buffer store 37. As discussed previously in connection with FIG. 1, one BOND output line is used to transmit character fields or words flagged as numeric (e.g., line 35), and the other output line is used to transmit character fields flagged as alphabetic (e.g., output line 36). It will be clear to those skilled in this art that it is within the spirit of the invention to input directly from an OCR to the upper/lower case print convention apparatus which is the subject of this invention without of necessity utilizing the BOND apparatus. Thus, and by way of example, the OCR output line 33 (FIG. 2) could be connected directly to line 35 which is input to buffer storage 37, and OCR output line 34 could also be connected to line 36, thereby effectively bypassing BOND 32.
The alphabetic character field output from buffer store 37 appears on line 38 for transmittal to alphabetic character shift register 39 and storage address register 41. The numeric output from buffer 37 is directed to numeric character shift register 42 along line 43. The control unit 44 initiates this process and maintains the output sequence of numeric and alphabetic fields identical to the input sequence of the character fields to the print convention apparatus. Accordingly, the numeric field character stream is directed to register 42 one character at a time, and the alphabetic field character stream is directed to registers 39 and 41 in parallel and one character at a time. At the input cell 45 for register 41, a line is connected to blank detector 46 for the purpose of testing the presence of a blank field or word separation "character". Upon detection of a blank, the decision process of the invention is activated by control unit 44.
Detection of a blank at input cell 45 of shift register 41 results in the alphabetic field character stream being shifted into register 41 at a rate of one character at a time. concurrently, each character in the alphabetic character field is sequentially loaded into register 39. The alphabetic character(s) stored in register 41 embodies the storage address for the upper case probabilities log P.sub.U (.alpha..sub.n) in the store 47, and the lower case probabilities log P.sub.L (.alpha..sub.n) in the store 48. The tables of upper and lower case occurrence probabilities are formed as described previously with respect to equation (1). These probabilities are stored in the storage units 47 and 48. As stated previously, the occurrence probability values in stores 47 and 48 are accessed by the alphabetic character appearing along line 49 from register 41.
The upper case occurrence probability values log P.sub.U (.alpha..sub.n) sequentially stored in output register 51 are sequentially added by adder 52 to the sequentially updated log P.sub.U (.alpha..sub.n) contents of storage register 53. The addition process continues in chain fashion until the sum of the upper case occurrence probability values has been calculated for the alphabetic character field stored in shift register 41 in accordance with equation (1). The end of the field is detected by testing for the terminating blank at the input cell position 45 of register 41.
Simultaneously, the lower case occurrence probability values log P.sub.L (.alpha..sub.n), are stored in output register 54, and then sequentially added by adder 55 to the sequentially updated log P.sub.L (.alpha..sub.n) contents of storage register 56. This addition process continues in chain fashion until the sum of the lower case occurrence probability values has been calculated for the alphabetic character subfield stored in shift register 41 in accordance with equation (1).
The sum of the upper case occurrence probabilities for a given field or word stored in storage register 53 are transferred to the register 57, whereas the sum of the lower case occurrence probabilities for a given field and stored in storage register 56, are transferred to register 58. The contents of register 58 are inverted in algebraic sign by inverter 59, and added to the contents of register 47 in adder-comparator 61. The output of unit 61 determines the print convention index. If the sum in unit 61 is greater than zero, output line 62 will be activated so as to imply that the character field is in upper case. If the sum within adder-comparator 61 is less than, or equal to, zero, the output line 63 is activated; the implication being that the character field or word is in lower case. As shown in FIG. 2, lines 62 and 63 are input to the upper/lower case identifier generator 64 which, upon command from control unit 44, generates either an upper or a lower case data flag depending upon which of the lines 62 or 63 was activated. This flag is appended to the alphabetic character field in shift register 39. Upon command from control 44, the contents of shift register 39 are output along line 65 to the output register 66 and print convention apparatus output line 67. Accordingly, and by way of summary, the alphabetic character field stored in register 39 will, dependent upon the activation of lines 62 or 63, be output with either an upper or a lower case flag associated therewith. The numeric character field is output as described previously from shift register 42 into output register 66 along the register output line 68. The clear unit 69 under direction of control unit 44 effectively resets storage units 53 and 56, and adder-comparator 61, as the system completes its operation with respect to one field or word, and prepares to receive another grouping of characters.
Referring to FIG. 3, the output of OCR 71 is applied to BOND 72 whose numeric and alphabetic character output is directed to buffer store 73 along lines 74 and 75, respectively. As described previously in connection with FIG. 2, the numeric character output from store 73 is transmitted along line 94 to register 76, whereas the alphabetic character output from store 73 is directed to registers 77 and 78 via line 95. Input cell 90 is a part of register 78.
Read-only store (ROS) 79 contains therein the PCI value for each upper case and each lower case alphabetic character output from register 78 along line 81. It also contains the PCI value for conflicts and rejects.
The access and use of the read-only store embodiment operation is illustrated in FIG. 4. The input from the alpha field shift register 78 (see also FIG. 3) is the OCR alpha field with each character in the field represented by a numeric code. This numeric code is assigned to each character by its position in a pre-defined alphabet, starting for example with upper case A = 1, and continuing sequentially through lower case z = 52. Additional special characters may also be similarly represented by higher numeric code numbers. The code is utilized for all OCR post processing to simplify computation. Persons skilled in this art will recognize that any code may be employed for the purpose of access to ROS 79, and that accordingly the code per se is not a critical part of this invention.
The example displayed in FIG. 4 shows an alpha word or field MAIm as having been provided by the OCR 71. This causes storage in the alpha field register 78 of the sequence (1, 9, 39) for the characters A, I, m, respectively. In accordance with equation (1), the first character of the alpha word or field is not included in the determination of the PCI value. The ROS 79 is arrayed in 52 or more sequential positions along a single axis. There is in each storge position a value which is the precomputed log of the ratio of the probability of a character .alpha..sub.i being an upper case font to the probability of .alpha..sub.i being a lower case font. For the example shown in FIG. 4, the indices 1, 9, and 39 are sequentially used to access ROS 79. Accordingly, the values +2373, +1788, and -2024 are read from ROS 79 and cummulatively summed utilizing the register 83, adder 84, and storage 85, respectively (see also FIG. 3).
The cummulative sum in buffer 86 for the example cited in connection with the operation displayed in FIG. 4 is +2137. The important characteristic of the value is the algebraic sign (i.e., the + or - polarity). A plus (+) sign indicates that the PCI value for the word or field is greater than unity (Log 1 = 0) with the implication that the original word read by the OCR was upper case. The sign is determined by outputting the value in storage 85 to the buffer 86 and along line 87 to the + or - polarity detector 88. If the detector senses a positive value, it will generate an upper case flag, and if it senses a negative value, it will generate a lower case flag. Accordingly, the field of characters sequentially transmitted from register 77 via line 97 to output register 88 and output line 89, will have upper or lower case flags consistent with the print convention case for the complete word. Accordingly, for the example in FIG. 4 discussed herein, the sequence of characters MAIm having had a PCI value +2137 will be output from the system output line 89 in FIG. 3, as MAIM. Control unit 92 (FIG. 3) effects a control corresponding to that of previously discussed control unit 44 (FIG. 2). Correspondingly, clear units 69 (FIG. 2) and 93 (FIG. 3) perform similar functions within their respective embodiment systems.
While the invention has been particularly shown and described with reference to the preferred embodiments thereof, it will be understood by those skilled in the art that the foregoing and other changes in form and details may be made therein without departing from the spirit and scope of the invention.