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:
- Navigate to Smart Bot > Computer Vision.

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

- Select Custom from the Template Type.
- Enter the unique Template Name in the textbox. Template Name must contain only alphanumeric characters.
- Optionally enter additional Template Description.
- 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
- 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.
- Select Field Type from the Form drop-down. The available Field types are:
- Form: Used to extract the data from the Form field structure (Key-Value structure).
- Table: Used to extract the data from the Table where, headers can have single or multiple values.
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)
- Barcode: Used to detect the Barcode from the document and extract the required data.
- QR Code: Used to detect the QR code from the document and extract the required data from the QR Code.
- Keyword: Used to extract the data based on selected keywords from the document. For example, when you want to search invoice type either PO Invoice or Non-PO Invoice from the document then, the keywords can be PO Date and PO number for PO Invoice and if the keywords are not found then the the document can be identified as Non PO Invoice.
- Master Lookup: Used to extract the data from a master-data based on the matched field which can be extracted from the document. The defined field is extracted from the document and the extracted value is searched in the master data and the matched data is returned based on seletced derived fields. For example, Vendor Code is available in the document which needs to be extracted, but the other metadata for Vendor is not there in the document. When the metadta is available in the master data then, you can extract the metadata based on the extracted Vendor Code.
Note: Currently only the CSV format of master data is supported which can be uploaded by the support team.
- Model: Used to extract data from the selected model. Select this field type if form fields are not possible to be extracted in specific scenarios when, there is no label against the value, or there could be different formats of the values. This field type can also be used when there are tons of formats and for each format, practically it does not possible to create a template.
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.
- 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.
- You can also Download and Upload the CSV file with defined Field Name and Field Type from any other template.

- In the Template Configuration section, you can provide template level configuration.
- Check Skew/Orientation: To apply the skew/orientation check for the uploaded document. Toggle, when the uploaded document requires a skewcheck and/or orientation correction in data extraction pipeline.
- Skew Orient Page Range: To specify the pages/ page range for data extraction for multiple page documents. Mention pages or page range to skew orient the specific pages only.
- Check Page Dimension: To check the Page Dimension. The uploaded document should be of a defined size for the system to function.
- Model Deployment URL: To provide the URL of the model that is to be utilized for the inference. It is mandatory when, the Model field type is selected.
- 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.

- In the Matching Master Fields tab, select Master Data Extention, for mapping the selected master fields with the master data.
- 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.
-
After mapping, derived fields are displayed in the Derived Fields pane.

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

- 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.

- 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.

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

- 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:
- Navigate to Smart Bot > Computer Vision
- Click Add Template.
The CV Template Details page is displayed.
- Add all the required fields with Field and Value type, and click Download CSV.
- All the field details are downloaded in an excel sheet in predefined structure.
- 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:
- Navigate to Smart Bot > Computer Vision
- Click Add Template.
The CV Template Details page is displayed.
- Select Template type and enter the required Template details.
- Click Upload CSV.
- Browse the required CSV file
- Click OK
- All the fields are displayed in the Add/Remove fields pane.
- 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.
- 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' ).
- 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').
- 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).
- 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').
- 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' ).
- 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).
- 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:
- Convert to Uppercase - Converts the entire output data string into an uppercase.
- Prefix Value - Adds desired prefix value to the output data string.
- Suffix Value - Adds desired suffix value to the output data string.