Community

To extract a confidence level at a field level and at a document level in the output .

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.

0

Comments

4 comments

  • Avatar
    sahota

    I am also looking for confidence score at field level. Any help ?

    0
  • Avatar
    sahota

    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

     

     

    0
  • Avatar
    Sara

    Hi Sahota,

    Can you send me the exact code and where to write that.

    Thanks

    0
  • Avatar
    sahota

    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();

    0

Please sign in to leave a comment.