Using CV Library from Nividous RPA

You can extract the content from the template created in the Computer Vision (CV) feature of the Smart Bot. The CV library helps to extract the text from the specified file using the template created in the CV from the Control Center.  The CV library provides action named Extract Data.

Extract Data

Pre-requisite for using CV library:

The pre-requisite to use the CV library for the text extraction:

  1. Add the configuration file application.cfg at the <PROJECT_DIR>/resources/ folder of the project. 
    The application.cfg file must consist of the following parameters for connecting the Smart Bot server with the Nividous Studio:
    [RPA]
    com.nividous.smartbot.user<<Username>>
    com.nividous.smartbot.password= <<Encrypted user password>>
    com.nividous.smartbot.url=http://<<Your Smart Bot IP address: <Port Number>>/api
  2. The Smart Bot must be up and running.
  3. If the SmartBot server and Nividous Studio are on the different machines, then after adding the required config file and importing CV library in the Nividous Studio, you need to perform the following steps:
    1. From the project explorer, right-click the process, and select Open With > RPA Source Editor.
    2. Enter the following arguments in the process:
          [Arguments]    ${invoice}
          ${filedata}    Get Binary File    ${invoice}
          ${fileDir}    ${fileName}    Split Path    ${invoice}
          ${partData}    Create List    ${filename}    ${filedata}
          ${multifiles}    Create Dictionary    ${EMPTY}=${EMPTY}    file=${partData}
          Set Process Variable    ${files}    ${multifiles}

      You need to add the Operating System library for the actions such as Get Binary File, and Split Path.
  4. Add CV from the Configure Libraries option in the process.

Extract Data:

To extract the content from the template using the CV library:

  1. On the Action field, press Ctrl + Space, and select Extract Data from the list.
  2. Enter the following parameters in the Input pane:
    1. Json - The JSON file of the created template.
    2. File Location -  The file name to extract the content. You can use this option only if your Smart Bot server and Nividous RPA is at the same location.
    3. File - The file name for extracting the content. If you use this option, then you need to perform the following steps:
      1. From the Project Explorer, right-click the process, and select Open With > RPA Source Editor.
      2. Enter the following arguments
        [Arguments]  ${invoice}
         ${filedata}    Get Binary File    ${invoice}
         ${fileDir}    ${fileName}    Split Path    ${invoice}
         ${partData}    Create List    ${filename}    ${filedata}
         ${multifiles}    Create Dictionary    ${EMPTY}=${EMPTY}    file=${partData}
         Set Process Variable    ${files}    ${multifiles}
      3. After adding the arguments, add ${files} at the end of CVLibrary.Extract Data action.
  1. You can store the result of the Extract Data action in a variable and print the output using the BuiltIn library. 

In this example, Json file of created template is used, and the result of the data extraction is stored in an output variable.
To view the output of the process in the log file, you can use the Log action from the BuiltIn library.

Through RPA process, you extract the data from different documents using a template which is created in the Smart Bot CV section.