AI Insights
As you learned in the previous section, Power BI integrates and takes advantage of outside tools to enhance the capabilities within itself. That continues to be the case with the AI Insights features. Leveraging the AI Insights capabilities gives you the ability to tap into core features and algorithms within Azure Cognitive Services and expose them within Power BI. So how can this be useful to you?
Imagine you work for a company that runs a vacation rentals website. Customers can book travel and post reviews of their trips on your website. With thousands of customers and hundreds of rental homes, it can be difficult to manage all the reviews that come in to make sure your locations are all meeting the standards your customers expect. With AI Insights you can run algorithms that can perform sentiment analysis, key phrase extraction, language detection, and even image tagging. So, if you have international customers that post reviews, you can use language detection to understand what language the post was written in. Then you can use sentiment analysis to capture whether the review was positive or negative. Finally, using phrase extraction, you can pull out key terms in the reviews to see if the same locations continue to receive feedback regarding similar problems. Furthermore, if your feedback system allows photos to be posted in the reviews, the image tagging capabilities can return a list of characteristics found in the images posted. This would allow for automated categorization of images using AI.
As you can see, these are very powerful features that take your analytics processing to the next level. There are limitations, however, that you should be aware of before exploring these features. As of the time that this book was published, Cognitive Services integration is only supported for Power BI Premium capacity nodes EM2
, A2
, or P1
and above. This means if your company is not currently leveraging Power BI Premium, then these features are not available to you.
Before using the AI Insights features in Power BI, you will need to change the capacity settings in the Power BI admin portal to enable the AI workload. After turning on the AI workload setting, you can also set the maximum amount of memory you would like to give the workload. The general recommendation is a memory limit of 20%.
In the next section, you will learn how to leverage an AI Insights Text Analytics feature called Sentiment Analysis.
Sentiment Analysis with Text Analytics
The Text Analytics features within the AI Insights features can be incredible time-savers. Imagine having to read paragraphs of information and conclude what was important or whether it was written in a positive or negative light. These are exactly the type of things that this feature can do for you. In this next example, you are going to test out one of these features by running a sentiment analysis algorithm on hotel reviews to see how customers feel about staying at your hotel locations:
- Launch a new instance of Power BI Desktop, and use the Excel connector to import the workbook called
Hotel Ratings.xlsx
found in the book source files. Once you select this workbook, choose the spreadsheet called Reviews in the Navigator window, and then select Transform Data to launch the Power Query Editor. - Select Text Analytics on the Home ribbon of the Power Query Editor. If this is your first time using this feature, you may be prompted to sign into a Power BI account that has Power BI Premium capacity assigned to it.
- Next, you will be prompted to choose which Text Analytics algorithm you would like to use. Select Score sentiment, as shown in Figure 2.25, and ensure the ReviewText field is the Text that will be analyzed. Then click OK:
Figure 2.25: Using the Text Analytics feature
- If prompted with a data privacy warning, click Continue and then select Ignore Privacy Levels check for this file before clicking Save. This type of warning can occur when you combine two disparate sources or services together and is to ensure it is OK for these data sources to be combined.
This transform will produce a new numeric column with a value between 0
and 1
for every row in the dataset. A sentiment score of .50
is considered neutral, while any score lower is negative and any score higher is generally positive:
Figure 2.26: Results of Score sentiment
Looking at Figure 2.26, it looks like the AI integration, with a few exceptions, did a good job determining how to rate each review.
Next, in the final section of this chapter, you will be introduced to the M formula language.