Text Classification using AI Builder inside Power Automate (Microsoft Flow)

Text classification is one of the important tasks for the aim of classifying the texts based on the allocated tags.
In the previous blog, the process of how to create Text classification in the Power Apps using AI builder has been explained,

In this Blog Post, you will see how to use the created Text classification model in the Power Automate (Microsoft Flow).

to strat

1- Login to Power Automated Account and to the same environment you have your own Text classify model created in the previous steps in the same environment.

2- In the next step, you need to login to the Power Automate,  just make sure to log in to the Power Automate in the same environment. Same as Other AI Builder solution in Power Automate, you need to create a new solution and other that create the Microsoft flow.

then click on the new Solution, “AICourse”. Then create a new Flow.

In the new page, create the Microsoft Flow, by trigger by ” Manually trigger a flow”, and add Input for the Text

in the new page call the text as “Mytext”. Next, we need to call the AI Builder using Predict for Common Data Services (CDS). So click on the “New Step” and search for the Predict.

In the list of the model, you can see the “textclassification”, we created alongside with other models. For the Request Payload

write the

{“text”:” “}

and

for the formula for the white space click on the “Mytext” which is the output of the previous step.

Next, change the name of the Flow and save the flow to click on the text at the top right of the window .

For the first time, you need to trigger manually.

Next, run the flow to get the JSON schema

When the  run finished, click on the output and copy the respond Payload

{“predictionOutput”:{“results”:[{“type”:”Care”,”score”:0.603922}]},”operationStatus”:”Success”,”error”:null}

Click on the Edit, and add a new Step for the Pars JSON.  then Click on the “Geberate from Sample” to extract the JSON code. The yu should see something like below

Just save and run the code. This time after a click on the Test Flow, I choose the Using data from Previous runs.

Now check the output, as you can see in the JSON code the output id Type is Care and the Score is 0.60.

 

The output is on the JSON format, you can then use it to automatically send the result to other platforms.

https://docs.microsoft.com/en-nz/ai-builder/text-classification-model-in-flow

 

 

Leila Etaati on LinkedinLeila Etaati on TwitterLeila Etaati on Youtube
Leila Etaati
Trainer, Consultant, Mentor
Leila is the first Microsoft AI MVP in New Zealand and Australia, She has Ph.D. in Information System from the University Of Auckland. She is the Co-director and data scientist in RADACAD Company with more than 100 clients in around the world. She is the co-organizer of Microsoft Business Intelligence and Power BI Use group (meetup) in Auckland with more than 1200 members, She is the co-organizer of three main conferences in Auckland: SQL Saturday Auckland (2015 till now) with more than 400 registrations, Difinity (2017 till now) with more than 200 registrations and Global AI Bootcamp 2018. She is a Data Scientist, BI Consultant, Trainer, and Speaker. She is a well-known International Speakers to many conferences such as Microsoft ignite, SQL pass, Data Platform Summit, SQL Saturday, Power BI world Tour and so forth in Europe, USA, Asia, Australia, and New Zealand. She has over ten years’ experience working with databases and software systems. She was involved in many large-scale projects for big-sized companies. She also AI and Data Platform Microsoft MVP. Leila is an active Technical Microsoft AI blogger for RADACAD.

Leave a Reply