Question
How can I calculate recognition confidence rate?
Answer
There are several options to calculate the recognition confidence rate:
- Confidence rate of a single character;
- Confidence rate of a field;
- Confidence rate of all characters in a document.
Confidence rate of a single character
Two possibilities to get a confidence rate of a single character are available:
- Export confidence into an XML-file as a mask in format “0010011”. You can enable Character recognition quality info option in Document Definition > Export Settings > select an export destination > Options button near the XML Document data format:
Please note that in this case certainly recognized character will be marked as “0” and uncertainly recognized – as “1”. The decision whether the character is certainly recognized is based on the settings specified in Highlight characters if confidence level is less than option in the field properties on the Verification tab: - It is possible to get a confidence level for every character in a field using ICharacterParams properties in script. For example, a line
int confidenceValue = Context.Field("FirstName").Symbols[0].Confidence;
returns a confidence value from 0 to 100 for the first character in the FirstName field. More information in the corresponding article in the Online Help: ICharacterParams.
Confidence rate of a field
It is possible to calculate a confidence rate of a field using a script. For example, the following script is provided in the official documentation for FlexiCapture 12: Sample scripts for creating custom rules: Field reliability check. The rule code provided below checks the number of uncertain characters in the field and clears the field if the number of uncertain characters is greater than or equals three. This is an Autocorrection script.
[VBScript]
Dim totQty, suspQty
Dim i
totQty = me.Symbols.Count
suspQty = 0
for i = 0 to totQty - 1
if me.Symbols.Item(i).IsSuspicious = true then
suspQty = suspQty + 1
end if
next
if suspQty >= 3 then
me.Text = ""
end if
[JScript]
var susp, qty, strpos, i, SC, strposPrev
strposPrev = 1
qty = 0
SC = "1"
susp = SuspiciousSymbols
for ( i = 0; i < susp.length; i++) {
strpos = susp.indexOf (SC,i)
if ((strpos != strposPrev) && (strpos != -1)) {
qty = qty + 1
strposPrev = strpos
}
}
if (qty >= 3) {
text = ""
}
Confidence rate of all characters in a document
It is possible to get a confidence level for the whole document using service fields with data sources Document uncertain symbols count and Document recognized symbols count. Please find more information about service fields in the Online Help: Service fields and Data source properties.
Comments
0 comments
Please sign in to leave a comment.