Question
Is it possible to get the recognition confidence rate for a field/document in Vantage?
Answer
It is possible to calculate the confidence rate of a field/document (if all fields will be taken into consideration) with the help of the advanced script rule:
- Open a Document Skill in the editor.
- Create a text field, call it for example Confidence.
- Add a script rule in the Confidence field Settings > New Rule > Advanced Script Rule.
- In the rule settings, mark all fields that should be taken into account while calculating the confidence rate.
- Make sure that the Confidence field can be changed by the rule:
- The sample script can be as per the following:
//add fields that should be take into account
var fields = [ Context.GetField("Number")
, Context.GetField("Date")
];
var totalCount = 0;
var confidentSymbols = 0;
//iterate through each field in the array
for (var j = 0; j < fields.length; j++)
{
var fieldCount = fields[j].Symbols.length;
totalCount += fieldCount;
if (fieldCount > 0)
{
for (var i = 0; i < fieldCount; i++)
{
if (!fields[j].Symbols[i].IsSuspicious)
{
confidentSymbols += 1;
}
}
}
}
Context.GetField("Сonfidence").Value = (confidentSymbols/totalCount*100).toString() + "%";
Comments
0 comments
Please sign in to leave a comment.