One of the requirements of my project is to extract a confidence level at a field level and at a document level in the output excel file. I tried it with the Service field in the document definition file which is working for the whole pdf but not on the basis of field wise criteria.
So, Kindly suggest a solution for this.
Thanks in advance.
Comments
4 comments
I am also looking for confidence score at field level. Any help ?
I was able to calculate field level confidence score at Document Processing stage (C#) .
Algorithm in C# Workflow Stage (Document Processing Type):
1. Extract field object from Document
2. Iterate Over all the Symbols in the Field Object
3. Keep track if individual character NeedsVerification
4. Calculate confidence = (NonSuspeciousChars/TotalChars)*100
Let me know if someone needs help with this.
Objects/Interfaces used : Document and ICharacterParams
Hi Sahota,
Can you send me the exact code and where to write that.
Thanks
Hi Sara , This code has to be written in Advanced Work Flow stage (C#) of Document Processing Type.
You may have to make few changes in field names . Following fields must exist in your Document Definition : "Your_Field_Name" and "ConfidenceScore".
string documentDefinationName = Document.DocumentDefinition.Name;
string newAddressParagraphPath=documentDefinationName+"\\Your_Field_Name";
string confidenceScorePath=documentDefinationName+"\\ConfidenceScore";
double iNonSuspeciousCount = 0.0;
double iTotalCount = 0.0 ;
double confidenceScore = 0.0;
foreach(ICharacterParams CharParam in Document.Field(newAddressParagraphPath).Symbols)
{
if ( ! CharParam.NeedVerification) {
iNonSuspeciousCount++;
}
iTotalCount++;
}
confidenceScore = (iNonSuspeciousCount/iTotalCount)*100;
Document.Field(confidenceScorePath).Text = confidenceScore.ToString();
Please sign in to leave a comment.