Example of Using Custom Templates

With Custom Templates, you can create a new template to extract required fields and values with defined types. 

To create a new Custom type template:

  1. Navigate to Smart Bot > Computer Vision

  1. Click Add Template.
    The CV Template Details page is displayed. 

  1. Select Custom from the Template Type.
  2. Enter the unique Template Name in the textbox. Template Name must contain only alphanumeric characters.
  3. Optionally enter additional Template Description.
  4. Click Upload File to select the document image that you have to extract data from form or table fields. The supported file types are png, jpg, and others. 

Note:Upload File option is not mandatory, if you want to create template using Bar Code, QR Code, Keyword, and/or Model related fields

  1. In the Add/Remove Fields pane, enter the field name given in the processed document in the Field textbox.
    To add more fields from the document, click the plus icon.
  2. Select Field Type from the Form drop-down. The available Field types are:

Note: When data looks like a tabular structure, but there is no posibility for multiple values then, consider it as Form field. (Key-Value pair)

Note:  Currently only the CSV format of master data is supported which can be uploaded by the support team. 

Note: For tabular data currently there is no support for the model-based fields. There is native support to annotate and train a model inside the platform only.

  1. Select Value Type from the Text drop-down. The Value type can either be Text, or Number, or Date, or Currency, or GSTNO, or PAN type. 
  2. You can also Download and Upload the CSV file with defined Field Name and Field Type from any other template.

  1. In the Template Configuration section, you can provide template level configuration.
  1. After defining the required fields, click Next

The Mapping page is displayed only when any one of the Field Type is selected as Master Field, Model, QR Code and/or Keyword from the Form drop-down list from the Add/Remove Fields pane.

The ROI Mapping page is displayed when the Master Field, Model, QR Code and/or Keyword Field Type are not selected from the Form drop-down list from the Add/Remove Fields pane.

In this example, the Mapping page is displayed with two tabs namely Matching Master Fields and Model Fields.

  1. In the Matching Master Fields tab, select Master Data Extention, for mapping the selected master fields with the master data.
  2. Select the corresponding Mapping Data Field.  Select Mapping Field Type as either Document or Model.  When any field is not extracted correctly then, you have to train the custom template with an available model.  
  3. After mapping, derived fields are displayed in the Derived Fields pane.

  1. You can Exclude the fields which are not required for further mapping. 

  1. In the Model Fields tab, for each model field, select a model from the Available Model drop-down list and select the required entity field from the Mapping Entity Field drop-down list. 

After mapping each model field with the corresponding entity, click Next.

The fields which require ROI mapping from the document are displayed. The added fields with the individual field properties, and the CV Template Field Selection pane consisting of the uploaded image is displayed.

You can map the fields from the uploaded document from this page.

  1. Map all the fields added from the Add/Remove Fields pane with the ROI mapping from the uploaded image or document, and click Next.

Setting data clean up and formatting rules page is displayed. You can perform the advanced configuration for the fields. 

  1. Select clean up rules for each field if required.  
  1. Select formatting rules depending on the selected data type. You can select the required input and output format for the value.   

  1. Click Save Template. The new template is added and displayed in the Templates section. 

Downloading and Uploading CSV

When fields are the same as one of the previous templates, this helps to reduce the time to enter all the fields again. The CSV has a predefined structure for field name, field type, and value type. 

Downloading CSV

You can download the CSV file while creating a template through the CV Template Details page.

To download CSV of a template:

  1. Navigate to Smart Bot > Computer Vision
  2. Click Add Template.
    The CV Template Details page is displayed. 
  3. Add all the required fields with Field and Value type, and click Download CSV.
  4. All the field details are downloaded in an excel sheet in predefined structure.
  5. If required, you can add or remove or modify the required field from the list.

Uploading CSV

You can use the Upload the CSV option to either newly created or downloaded from the previous template through CV Template Details page. 

To upload CSV for the template:

  1. Navigate to Smart Bot > Computer Vision
  2. Click Add Template.
    The CV Template Details page is displayed. 
  3. Select Template type and enter the required Template details. 
  4. Click Upload CSV.
  5. Browse the required CSV file
  6. Click OK
  7. All the fields are displayed in the Add/Remove fields pane. 
  8. If required, you can add or remove or modify the required field from the list.

Clean Up Rules and Formatting

This section describes all the clean up and formatting options that are available during creation of a new template. The implication of these rules are not in particular order. These are used to make results more accurate with the help of data post processing. There are seven clean up rules and three formatting options available, if any requirement do not match with these options then, you can write an adapter with custom implementation. 

  1. Replace Char with Char

This clean up rule substitutes one character of the output data with another desired character. For example, TN-Z73-U-88643767 → TN-7383-U-88643868 (The character 'Z7' can be replaced by '78' ).

  1. Replace Char at Index

This clean up rule replaces one character at the output data with another character at a particular location (index of the string). For example, TN-73-U-3767 → TY-73-U-3767 (The character at the 2nd position 'N' is replaced by 'Y').

  1. Apply Pattern

This clean up rule enforces a RegEx pattern on the selected output data. This rule can be used when, only a certain portion of the output data is required. For example, TN-73-U-3767 → TN-U-(Here, the '[A-Za-z]' regular expression pattern is enforced to scoop out only the letters without the number from the data).

  1. Replace Text at Start

This clean up rule replaces one character of the output data, which is located at the first index position of the string, with another character. For example, TN-73-U-3767 → YN-73-U-3767 (the character at the first position uppercase 'T' is replaced by uppercase 'Y').

  1. Replace Text at End

This clean up rule replaces one character at the output data, which is located at the last index position of the string, with another character.  For example, TN-73-U-3767 → TN-73-U-376n (The last character '7' is replaced by a lowercase 'n' ).

  1. Remove Special Character

This clean up rule completely removes all the special characters from the output data. For example, TN-73-U-3767 → TN73U3767 ( All the special characters from the data are removed). 

  1. Remove Space

This clean up rule removes any unwanted free white-space from the output data string. For example, TN 73 U 3767 → TN73U3767 ( All the unwanted free white-space from the data is removed).

The Formatting rules for any given field work in conjunction with these cleanup rules and they are as follows:

  1. Convert to Uppercase - Converts the entire output data string into an uppercase.
  2. Prefix Value - Adds desired prefix value to the output data string.
  3. Suffix Value - Adds desired suffix value to the output data string.