How to do Sentiment Analysis on News Headlines with Power Automate Desktop

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this video you will learn how to build intelligent automations we will extract headlines from the huffington post and do some sentiment analysis with them all of this with power automate and azure from microsoft welcome rpa champions i am the rpa champion and in today's video we are going to be discovering ai services in power automate power automate is known for automating the manual and repetitive tasks that you have on your desktop but just imagine if you could add ai services to your processes that would mean that you could automate also cognitive tasks and that means that you could automate a process from the beginning until the end well with all that in mind let's jump into this video and start learning ai services in power automate and we're gonna do this with sentiment analysis i have built a process that i'm going to walk through in just a moment but before that i want to make sure that you understand one thing you should use power automate flow if you really want to do a lot of api integrations for ai services power automated desktop comes only with these ai apis that you can use and connect to other apis are not available for power automate desktop to connect to therefore you cannot use any other ai services apart from the ones that are available right here in the cognitive sections in your actions so we have google ibm microsoft aws services are missing they have virtual machines but they do not have any any cognitive services from aws that means that if you want to use some machine learning services like poly from aws with microsoft power ultimate desktop you cannot but you can with microsoft power automate flow with all of that in mind let's jump into this process and understand how we use cognitive services in microsoft power ultimate in this example we are going to be doing some sentiment analysis on some text that i will extract from a webpage so to start this process we are opening the huffington post and we are getting the new the news from this page so after that we are going to be extracting the news from this page let's add a breakpoint and launch this this is the page that we are going to be automating and since i want to show you step by step we are going to be seeing everything what we do so let's pause our process right now let's actually stop it let's extract data from web page this page if we go to google chrome we can see what we have we have i have created two tables or two uh two columns in one column we have this that i have done so to extract i have right click inside of the element and i have selected the text the same i have done for this now i will add this text as well so let's add this text as well we have added well i have actually i will add all the text so let's add the first part of the text and let's add the second part of this text the next thing that we have those this is also a list it's not a table we have select the next element that we want power automate to identify automatically and as we can see it has identified both of the uh the title or the title and the body of the article let's rename our columns one is going to be title and one is going to be body with that what we want to do next is we want to set this as the pager so select this element as a pager that means that this uh power automate is going to extract all of the elements and it's going to click also on next to see the elements on the next page let's click finish and this is what we have right now just to go over this we can extract all of the data it will go through all of the pages or we can only select the pages that we want in this case i will be using only five because we want to extract only five for five pages since we are going to be only testing our process right now since while we're testing our process we don't want to extract everything or it will just take too long let's save it and let's continue with our process the next thing that we are doing is we are launching excel why because later on we are going to be writing the results inside of an excel table so everything that we extract from this page let's go over it one more time everything that we extract from here we are going to be saving it in excel file and we're going to be doing some sentiment analysis on the title back to our process we have to tell excel where we're going to be writing all of the information i have an excel file open this is what it's going to look like in the end let's clean it out the first cell this is where we're going to start writing the titles and this is where we're going to be writing the sentiment analysis score this is what we have right here i have chosen the action of get first column from excel that is available so you can do that either by typing it here or for looking for it here under the excel actions in here i have just selected the excel instance that i have opened previously and in launching in excel we have created a blank document after that we are going to be doing something pretty interesting so we're going to be setting a variable and we're gonna take the current item of the loop that we have created so we're gonna create a loop on everything that is extracted from the web page so this loop which is for each loop and if we go to the loop sections and we select this we are going to iterate it on all of the elements that are extracted from the web page that means that we are going to create a loop that is going to go through each one of these titles and each one of these descriptions of titles that is our loop our loop is going to save all of those results in a current item one by one so the first result is going to be in current item then in the next cycle of the loop the next result is going to be in the current item and so on with that what we are doing right here we are creating a new variable we are setting a variable and we are going to access only the row code or the column called body so we're gonna just save the content of the body column and we're gonna save it right here we're gonna save it in target after that we are finally going to do some sentiment analysis so to do sentiment analysis is pretty simple all we have to do is look for the cognitive services and select from the few ones that are available in this example we are going to be using sentiment analysis so we just drag and drop the sentiment analysis and fill out the basic information that is required the subscription key and the subscription key you can get it from text analysis api from microsoft so in this example i'm using microsoft azure and i can either go to more info and go on the documentation of microsoft and understand how it works or i can also go to the azure page and i can show you how it's set up so this is the microsoft azure dashboard what you need to do is search for text analysis click on this and create create a new instance so once you have created a new instance you are going to be able to click inside of it and then go right here into keys and end point select your endpoint or your well your api key go back to the power automate and put your subscription api that's pretty much it the other thing that you have to do is make sure that you select the right region the right region is also in your documentation if you go inside of your overview you can see your documentation right here with your documentation and your subscription key that is everything else that you require the next thing that you have to do is put in the text and the text is going to be in our example some dynamic variable so in a not a dynamic variable is going to be our target variable right here so we are going to do something that is going to be like this just select our target and that is going to be the text that we are going to send for sentiment analysis the language is going to be english and that's pretty much everything so i will not save that because i have already created it and i will also not be opening mine because i have the api key in plain text so that is how we do sentiment analysis and that's how pretty much every single one of these services api services works you add a key phrase you add the element that you want either analyzed checked out or downloaded or processed or converted etc etc so feel free to check out all of these i will be making more videos about the other services and some cool use cases but let's finish this process and see it in action one more time so once the sentiment is complete now we're gonna do some interesting stuff we are gonna write all of this information inside of an excel file so that we can save it and have it for ourselves so to write information inside of an excel file we have to select the excel instance select the target which is going to be the the title that we are extracting so we are gonna write the title in column a let's review the excel file here we're gonna put the title and here we're gonna put the score so that is going to be the target and we're gonna put it on a specific cell also we have to select the row so remember that we've created this get first row on column excel so this is going to tell x microsoft power automate to always write it in the following row so with that done for the first row we have to do something similar for the score so for the score of the sentiment analysis we have to create another variable save this variable and extract the information from the sentiment analysis what does that mean now let's run this process until here and see what happens so it is opening a new document it is should start extracting all of the information it has opened the excel file did we add a breakpoint yes we did that is excellent so let's check out the response from the sentiment so if we go right here and we see that we have the response is right here but maybe we want a clean response we won't just get this score to do something like that you would usually click on more and you would be redirected to another page so in this page you can see right here that we are accessing the variable json at documents zero now if we add also score we can get exactly the score right here so this is what i am doing right here i'm creating a variable and calling it target two and i'm accessing exactly that score that score right here i'm accessing exactly that score so that i don't have a messy json file so that's pretty much it that is our process the last thing that we do is we write the we write our target 2 which is our score to the excel file and we have created a ai process that does sentiment analysis on the titles of the huffington post so that's pretty much it ladies and gentlemen i hope you have enjoyed this video i hope that you have learned something new and i'm really excited that you are learning and learning more and more about automation automation is fundamental it is becoming a everyday quantity that everybody should know so stick around for the next video and give yourself a high five thank you so much for watching and see you in the next one
Info
Channel: RPA Champion
Views: 151
Rating: 5 out of 5
Keywords: Power automate desktop, power automate, microsoft power automate desktop, microsoft power automate, Microsoft Power Automate, microsoft power automate tutorial, power automate tutorials, Power automate desktop automation, power automate tutorial, power automate desktop automation, Microsoft Power Platform, power automate examples, power automate training, Working with Analyze Sentiment, Power automate desktop Analyze Sentiment, sentiment analysis, rpa champion
Id: WLd57Juu8vk
Channel Id: undefined
Length: 13min 28sec (808 seconds)
Published: Sat Sep 11 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.