Recently, I was happy to discover that cognitive services have been added to Microsoft Flow! So in this tutorial we are going to see how we can make Sentiment Analysis on Twitter Posts, using Microsoft Flow.
Text Analytics
To use Text Analytics you need and API Key. Get yours here.
Microsoft Flow
Microsoft Flow is an online workflow service that automates events (known asĀ workflows) across the most common apps and services. For example, you can create a flow that adds a lead to Microsoft Dynamics 365 and a record in MailChimp whenever someone with more than 100 followers tweets about your company.
When you sign up, you can connect to more than 220 services, and can manage data either in the cloud or in on-premises sources like SharePoint and Microsoft SQL Server. The list of applications you can use with Microsoft Flow grows constantly.
For an introduction to Microsoft Flow you can check out this learning module.
Microsoft Flow is included with some Office365 plans, or you can use the free edition to experiment. Sign in with your account (Microsoft account or Office365 here)
Create your flow
After you have signed in you will see the Home Page. Click My Flows
Here you can see all the flows you have created. Click New on top to create a new one and choose Create from blank.
In the next screen Choose When a new tweet is posted from the popular triggers.
You will see the following screen. Add #codestories as the hashtag to monitor. By Adding New Step you can build your flow.
Click Next Step and Choose Text Analytics, Detect Sentiment.
Now get back to where you got your API Key and fill in all the fields.
Then continue building your flow as follows. To add Original Tweet to detect Sentiment use the Add dynamic content button. Then create a Condition. If Score is less than 0.4 send a notification to my mobile, that there is a negative tweet posted about #codestories.
You can also see the steps in this mini video:
Thats it! Save your flow with the name you want and lets go test our flow. Use the button on the top right and choose I will perform the trigger action.
Now its time to post a new tweet and see the results.
In the previous screen I can see all my flow runs.
Choose one to check which steps were followed and their results.
Sentiment analysis has never been simpler!