Multiple profiles recognition.

Multiple profiles recognition.

Postby » Thu Jul 17, 2014 12:50 pm

We are developing a batch class with two document classes each of which has multiple forms.
We need to do recognition for these forms using two different recognition profiles of different types (barcode and ICR), with scripts, on each document. Is it possible that recognition engine will read one script, make recognition based on it, and then additionally do the same using another script? In other words will recognition module execute the post-recognition script of the barcode profile, and then execute the post-recognition script of the ICR profile?
Participant
 
Posts: 51
Joined: Thu Jul 19, 2012 12:06 pm

Re: Multiple profiles recognition.

Postby » Fri Jul 18, 2014 12:54 pm

You will have two zones, each with its own profile and script.

If these are Form ID zones, all the scripts for all the Form ID zones will be read, and the one with the highest confidence value wins and that will be the return value and hence the Form Type identified.

If these are just Index Field zones, then both scripts will run returning their respective values. A couple of things to note:

1. A Recognition Script has no knowledge of the Index Field it is assigned. It simply returns a value and the Recognition module performs the processes under the hood to make the assignment of the value to an Index Field.

2. The order in which these scripts are executed is indeterminate. You could have 1 run before 2 on one run and the next run executes 2 before 1.
If they are going to hate you anyway for what you do, then you might as well put forth your best effort.
User avatar
Participant
 
Posts: 62
Joined: Tue Apr 10, 2007 8:11 am

Re: Multiple profiles recognition.

Postby » Mon Jul 21, 2014 7:31 am

There are the Form ID zones. The batch class has two types of document classes with form id zones recognized by barcodes, and two other with form id zones recognized by ICR. For some reason I do not have a good recognition when I set Confidence and Difference to 0,even for barcodes.
I am trying all this work only from scripts, but I in order to have it working I must set Confidence and Difference with some walues. Am I missing something?
Participant
 
Posts: 51
Joined: Thu Jul 19, 2012 12:06 pm

Re: Multiple profiles recognition.

Postby » Mon Jul 21, 2014 11:59 am

How are you setting your zones? Out-of-the-box, Kofax wants a fixed text message to come back and will judge the results on how well the text matches what's expected. (NOT on the OCR confidence.) It doesn't work by "I have text" vs. "I can't read it".

What I do in that situation is create a recognition script that determines if I have a valid result and return a "Yes" or "No" with a matching confidence level. Then in Kofax, I tell it to look for the "Yes". So in this case I might call one ID "Barcode" and the other "Handwriting". If the barcodes has a value, any value, then I set the return text to "Yes". Which of course matches perfectly with the text "Yes" I'm expecting. Handwriting might be trickier since it might see something in a barcode.

And when coding the script, make sure it not only recognizes the desired page, but that it gives the appropriate answer for the wrong page. Because what Kofax does is run both scripts. If one says "Yup" and the other one says "Nope", then it all works. But if the results are either both "Yup" or "Nope", then Kofax doesn't know what to do because the confidence is the same and there's not difference in the results.
Russell
Participant
 
Posts: 3374
Joined: Wed May 17, 2006 12:53 pm
Location: USA

Re: Multiple profiles recognition.

Postby » Tue Jul 22, 2014 12:47 pm

I have barcoded zone located at the same place for the all barcoded forms. On text zoned forms this area is blanked, but the text zone on this forms can hit the place with irrelavant text in barcoded forms that is mutch loger than the searced value from text zone.
My scripts look like:
For barcode recognition:
if e.Value.trim.Length>0 then
If e.value.thim="123" then
e.Value="FormType1"
Else
e.Value="FormType2"
else
e.Confidence=0
end if

For text recognition I have:

If e.Value.Trim.Length > 0 Then
If e.Value.Trim = "123" Then
e.Value = "FormType3"
e.Confidence = 100
Else
If e.Value.Trim.Length <= 4 Then
e.Value = "FormType4"
e.Confidence = 100
Else
e.Value = ""
e.Confidence = 0
End If

End If
Else
e.Value = ""
e.Confidence = 0
End If
In all cases expected results are set to FormType1..2..3..4. But I still do not getting good result for "FormType3".
Participant
 
Posts: 51
Joined: Thu Jul 19, 2012 12:06 pm

Re: Multiple profiles recognition.

Postby » Tue Jul 22, 2014 12:51 pm

In my previous reply I missed part of statement for barcode recognition:

if e.Value.trim.Length>0 then
If e.value.thim="123" then
e.Value="FormType1"
Else
e.Value="FormType2"
end if
else
e.Confidence=0
end if
Participant
 
Posts: 51
Joined: Thu Jul 19, 2012 12:06 pm

Re: Multiple profiles recognition.

Postby » Tue Jul 22, 2014 12:55 pm

You may want to verify what text comes back from the type 3. You're limiting your self to exactly "123" and it will fail if it's "123.". You might want to change the test to "contains" 123.

I think you've got the general idea. Make sure it works in Admin first. And test it on a "wrong" sample to make sure that gives your the right results.

Oh, and when you post code, you might want to use the "code" tag to preserve indenting.

Code: Select all
If e.Value.trim.Length>0 then
   If e.value.thim="123" then
      e.Value="FormType1"
   Else
      e.Value="FormType2"
   end if
else
   e.Confidence=0
end if
Russell
Participant
 
Posts: 3374
Joined: Wed May 17, 2006 12:53 pm
Location: USA

Re: Multiple profiles recognition.

Postby » Tue Jul 22, 2014 1:08 pm

Thank you Russell.
One more, maybe naive question.
Could you please explain what you mean by:

Oh, and when you post code, you might want to use the "code" tag to preserve indenting
Participant
 
Posts: 51
Joined: Thu Jul 19, 2012 12:06 pm

Re: Multiple profiles recognition.

Postby » Wed Jul 23, 2014 4:09 pm

ddavydov wrote:Could you please explain what you mean by:

Oh, and when you post code, you might want to use the "code" tag to preserve indenting

There might be more than one edit to edit posts. But the one that comes up for me has a "code" button just above the text area. It inserts a pair of tags that say "[ code ]" (With out the space.) Anything inserted between them is treated as code and not as text. The results are much easier to read.

Without the code tag:
If e.Value.trim.Length>0 then
If e.value.thim="123" then
e.Value="FormType1"
Else
e.Value="FormType2"
end if
else
e.Confidence=0
end if



With the code tag:
Code: Select all
If e.Value.trim.Length>0 then
   If e.value.thim="123" then
      e.Value="FormType1"
   Else
      e.Value="FormType2"
   end if
else
   e.Confidence=0
end if


Exactly the same text, but it get formatted differently.
Russell
Participant
 
Posts: 3374
Joined: Wed May 17, 2006 12:53 pm
Location: USA

Re: Multiple profiles recognition.

Postby » Thu Jul 24, 2014 8:59 am

Thank you Russell.
Participant
 
Posts: 51
Joined: Thu Jul 19, 2012 12:06 pm


Return to Custom Modules General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest