This is the second and final blog on Sentiment Analysis and its implementation in Power BI series. In the first part, we learned the basics of Sentiment Analysis. We also discussed why it is important and how it is done theoretically. In this part, we will implement an end-to-end Sentiment Analysis pipeline in Power BI using Azure Cognitive Services. To read the first part, click here.
Sentiment Analysis in Power BI using Azure Cognitive Services:
Azure Cognitive Services provide cloud-based AI capabilities, including text analytics such as Sentiment Analysis and keyphrase extraction. Its documentation can be found here.
Pre-Requisites:
The implementation of Sentiment Analysis in Power BI is simple, and this blog is intended to provide set of instructions to get you started with
Sentiment Analysis in Power BI. However, to implement the working example, there are certain pre-requisites:
- A beginner level knowledge of Power BI or that of a similar reporting application
- Power BI Desktop
- Azure Account with Text Analytics set up. Azure allows a free trial of its Cognitive Services, which can be set up completely free here. Once, Azure Cognitive Service’s Text Analytics is set up, it will provide us following information that is required we will need for the case study below:
◦ API key
◦ Endpoint
Now without further ado, it is time to implement a basic Sentiment Analysis pipeline.
Data:

Importing the Data:
Custom Function:
Authenticating and Connecting to the API:


Consolidating the Results from Azure Cognitive Services:
Reporting:
Once we have done that, we can click on “Close & Apply” in the home tab to do any modeling and to perform reporting and , analytics on the prepared dataset. As can be seen below, we can filter the data based on any selection. We can also slice and dice the data and perform advanced analytics on it.

Conclusion:
To conclude, these two blogs have given us an understanding of what Sentiment Analysis is. We also know its most common applications for business users. We also briefly discussed the inner workings of a Sentiment Analyzer. Finally, we looked at how easily we can implement a Sentiment Analysis pipeline in Power BI using Azure Cognitive Services.