PowerApps AI - Text Classification

Introduction

 
Artificial Intelligence is the latest trend in the industry. Machine learning and AI are interrelated. Machine learning is a technique where machines learn using various algorithms and tagged data. Artificial Intelligence is a technique, using which machines can execute tasks smartly by applying machine learning.
 
PowerApps provides a rapid development environment to build custom business applications. Furthermore, it automates business processes by leveraging flows and providing rich integration with data sources using CDS, online and on-premise.
 
AI builder, which is still in preview, provides an opportunity to integrate PowerApps and AI to automate processes, predict sales, and classify data, which will help in tagging data by providing some meaningful insights to organizations. Object detection can be used to detect images and tag them, while form processing can help the  insurance industry to process claims faster by extracting data from documents. This AI integration will turn out to be a power booster for O365.
 

Prerequisites

 
You need not be a data scientist to use AI Builder, as all the algorithms are embedded in the tool. The most important aspect is having data, it can be either text, images, or pdf. In addition to this, understanding about associating model with data is required as well. Choosing this correctly will enable machines to create correct patterns, learn and help in achieving automation goals.
 

Data 

 
In today's instance, I will take text classification as an example and we will see how the text classification model can tag data for your customers/organization.
 

CDS

 
Common data source service is like a relational database which stores data in the entity, which are similar to tables. Rules and business logic can be applied to the data source itself, so there is no need to recreate these rules again in PowerApps. There are various ways to do a mass upload of data onto CDS. For example, CSV, JSON, XML, Azure, SQL Server and many more.
 

AI Builder(Preview)

 
To use AI, your data should be preloaded into CDS.You may choose from one of the below models depending on the requirement.
 
Please refer to GA dates to see the dates for general availability.
 
 AI  Model  Category
 Binary Classification  Prediction
 Text Classification  Language
 Form Processing  Vision
 Object Detection  Vision
 

Text Classification

 
This AI model needs tagged data with at least 50 items per tag and a minimum of two tags.
 
We will use the below steps to achieve a working text classification model. 
 

Load Data in CDS

 
Once you are in your PowerApps environment, click on Entities and follow the below steps.
 
Click Get data. 
 
 PowerApps AI - Text Classification
 
Select Text/CSV, enter URL of your data source. Please note, the data should be tagged and should have at least 50 items per tag.
 
You can upload your files on GitHub and provide URL.
 
PowerApps AI - Text Classification
PowerApps AI - Text Classification
 
Data gets displayed, you may apply Transformation if required.
 
PowerApps AI - Text Classification 
 
Click "Next" and follow the steps to complete the load. It will take time according to the data size. Select primary, key fields and give a name to your entity.
 
PowerApps AI - Text Classification
 

AI Builder

 
Let's go to AI Builder Preview. There may be some changes in steps or UI when this become GA but the overall concept should remain the same.
 
Click on Build. Select Text Classification.
 
 PowerApps AI - Text Classification
 
PowerApps AI - Text Classification
 
Click on Select Text, and select the Entity we created.
 
Click on Select tags.
 
PowerApps AI - Text Classification
 
PowerApps AI - Text Classification
 
Follow the wizard and click on "Train".
 
PowerApps AI - Text Classification 
 
Once your model is trained, you will be able to publish it. The last trained date should appear before you go and publish.
 
PowerApps AI - Text Classification 
 
 PowerApps AI - Text Classification
 
Once published, go ahead and click on the Quick Test to test your AI model. In the below screen, we seesuggested tags and confidence for the input text.
 
PowerApps AI - Text Classification

Conclusion

 
In this article, we learned the basic concepts and steps to implement Text Classification model.


Similar Articles