Subscribe to receive exclusive content and notifications
UiPath AI Fabric Hands-On Exercise & Tutorial 2020
(Part 2- Complete Working Example with Out of Box ML Models)
In this part of article, I’ll cover-
- How to use your deployed ML Skills into Project (Continue from last article)
- Consuming an ML Skill in UiPath Studio
- Working example of Google Apps Comment Sentiment Use Case
- Building Task for Human to validate using form activity
- GitHub Project Repo to play around code.
You will need –
- UiPath Studio v 2019.10+, with UiPath Robot v 2019.10+ and UiPath Orchestrator 20.4
- AI Fabric Enabled Orchestrator Instance (You can request for Free Trail for Enterprise Edition)
- Licence for AI Robot
- Already deployed ML Project in AI Fabric for Consuming an ML Skill in UiPath Studio
Your good starting point could be already developed code. Which you can download form my Git Hub repo.
This repo contains working example of sentiment analysis Out of Box ML Packages to review the comments of android apps on Google play store.
UiPath AI Fabric | Working Example with Out of Box ML Packages
Below are the minimum set of Activities you need to enable for working with ML Skills.
You might need other activities based on changes you wish to do into project such as writing result back to excel file.
For this example, we have used the data set of 10000+ Android Apps and their Review for explaining the various operation. You can download from below.[Source Kaggle]
The Project is created with simple workflow without using re-framework. It has 5 Workflows for different tasks.
- Init – In this workflow, the Dataset (Google Apps Comment CSV) file is read and stored into data tables for easy handling.
- Get_Next_AppReview – In this workflow, logic is applied to read 1 comment at a time and loop over the data tables.
- Classify_App_Review – In this workflow, ML Skill is invoked using given input and Output JSON is deserialised to get the required columns from the dictionary object.
- Save_And_Move_To_Next – In this workflow; I have saved the results as write line activity, You can modify this to store in data tables or pass this to another workflow for post-processing.
- Main- Its flow chart based workflow and ties all the above components together.
We have also implemented, Human in loop validation in Main Block. We will discuss that in the next section.
Consuming an ML Skill in UiPath Studio
- In UiPath Studio, drag and drop the ML Skill Activity into workflow.
- Select the Refresh ML Skills option to populate the drop-down list with all the successfully deployed ML Skills from the AI Fabric tenant.
- Pass the data to the input of the ML Skills exactly as we would with any other activity.
- The ML Skill also allows to live test an input by selecting Test Skill.
- Once deployed as ML skills, models can be used with regular UiPath Robots (attended or unattended).
Human in Loop
This example also uses the concept of ‘Human in Loop’.
The Bot is designed in such a way that it compares the Confidence score of the ML Skills with pre-configured value.
If the confidence score is low, Bot creates a task in the action centre in Uipath Orch.
As this will be working as an Attendant Bot, WOrkflow will stop and wait for the action to be completed by ‘Human in Charge’ and save the corrected data as output.
This workflow can be further enhanced to pass corrected data to ML Skill for retraining.
Once Action has been validated, Bot will resume its processing for the next item in the pending list.
How to Create a Form Task.
The Persistence Activities pack has been developed as part of the Human In The Loop initiative, offering you several activities that help you manipulate Jobs, Tasks, and Queues in Orchestrator.
for designing form task, All you need to do is Use ‘Create Form Task’ Activity. You need to map and Build Form Data which will be used as INPUT/OUT which you want to display in a form within the orchestrator task inbox.
Modifying OUT and IN/OUT arguments maps them back to the workflow after task completion.
After that; You need to add
UiPath.Persistence.Activities.FormTask.WaitForFormTaskAndResume Activity to suspend the execution of the current workflow until a specified Task is completed.
You can play around various properties to configure as per your need.
Related Blog Post links –
- UiPath AI Fabric Tutorial | Build Your ML Based RPA Project [Part 1]
- UiPath AI Fabric Tutorial | How to Use ML Skill in UiPath Studio [Part 2- This Article ]
- UiPath AI Fabric Tutorial | How to Deploy Own Model in AI Fabric [In Draft facing some challenges with the deployment will post soon ]