Using Voting API
Developers can combine several Engines in their recognition solutions. When multiple Engines generate different recognition variants for a character or word, the developer can select the best variant by voting between the variants. To enable voting, the ABBYY FineReader Engine has a special Voting API that provides access to different hypotheses of character or word recognition with corresponding weight values. In addition to voting, the developer can use the Voting API to check recognition results using his own databases and algorithms and to correct text. For example, the developer can build words from letters or check all generated hypotheses.
Important! The Voting API is not available for handprinted texts recognition.
The WordRecognitionVariants object represents a collection of hypotheses for a word, and the CharacterRecognitionVariants object represents a collection of hypotheses for a character. The elements of these collections are the WordRecognitionVariant and CharacterRecognitionVariant objects, respectively.
The WordRecognitionVariant object represents a single hypothesis for a word and contains the text of the hypothesis, type of model, the average width of a stroke, and information on whether the hypothesis has been found in the dictionary. The GetCharParams method of this object provides access to the parameters of a single character.
The CharacterRecognitionVariant object represents a single hypothesis for a character and contains character confidence, the probability that a character is written with a serif font, and information on whether the character is superscript or subscript.
How to retrieve recognition variants for a word or character
If you wish to find out all recognition hypotheses for a word or character, do the following:
- Set the SaveWordRecognitionVariants and SaveCharacterRecognitionVariants properties of the RecognizerParams object to TRUE. This will instruct FineReader Engine to save recognition variants in the recognition results.
- Pass the RecognizerParams object as a subobject of the PageProcessingParams object (or the DocumentProcessingParams object which contains it) to one of the ABBYY FineReader Engine recognition methods.
- The collection of hypotheses is accessible after recognition through the ICharParams::WordRecognitionVariants, ICharParams::CharacterRecognitionVariants properties and the IParagraph::GetWordRecognitionVariants method.
Note: These methods return zero for non-printable characters (spaces, carriage returns, etc.) and characters that were not recognized but added to the text during editing. Zero is also returned if the text was recognized by one of the previous ABBYY FineReader Engine versions. The hypotheses collections contain recognition variants ranked from best to worst. If the SaveWordRecognitionVariants or SaveCharacterRecognitionVariants property of the RecognizerParams object is set to FALSE, the corresponding collection will contain only one element.
C++ (COM) code
C# code
What is the difference between the CharConfidence and the IsSuspicious properties
The CharConfidence property of the PlainText and CharacterRecognitionVariant objects is a read-only int property that provides an accuracy estimate of the character image recognition. The IsSuspicious property of the CharParams object is a Boolean property which, when set to TRUE, indicates that the character was recognized unreliably. CharConfidence estimates accuracy with no regard for the character's context, while reliability (IsSuspicious) is based on both recognition accuracy and the context — for example, dictionary analysis of the word to which a character belongs.
When recognizing a character, the ABBYY FineReader Engine provides several recognition variants with a confidence value for each. This value is an internal estimate of the probability that a variant is correct — that is, in fact, the recognized image does represent this character variant. For example, an image of the letter "e" may be recognized:
- as the "e" character with a confidence of 95,
- as the "c" character with a confidence of 85,
- as the "o" character with a confidence of 65, and so on.
Confidence values are in the range from 0 to 100. If a character was obtained not as a result of recognition, its confidence is set to 100 — for example, the confidence of a character extracted directly from the source PDF file.
Note that the confidence should not be understood as a general recognition quality measure. Confidence estimates for different characters are incomparable, and the only safe use of confidence is for comparing several recognition variants of the same image (character). Moreover, higher confidence of a recognition variant does not guarantee that the variant will be selected as the recognition result. This choice depends on the context (the word to which a character belongs) and the results of a differential comparison. For example, if the word with "e" (confidence 95) is not a dictionary word while the word with "c" (confidence 85) is a dictionary word, the latter is selected as the recognition result, even though its confidence is lower.
The selected recognition result may then be marked as suspicious using the IsSuspicious property of the CharParams object. This property is determined by an algorithm that estimates reliability taking into account a number of parameters, such as recognition confidence of the selected variant, confidence of character's other variants, nearby characters and confidence of their recognition variants, geometric parameters of the character, and the character's context (word). If the reliability estimate is lower than a certain threshold, the IsSuspicious property for this character is set to TRUE. Such suspicious characters are highlighted in the ABBYY FineReader.
See also
9/17/2024 3:14:40 PM