You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/ai-services/language-service/key-phrase-extraction/tutorials/integrate-power-bi.md
+20-20Lines changed: 20 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ ms.custom:
18
18
19
19
Microsoft Power BI Desktop is a free application that lets you connect to, transform, and visualize your data. Key phrase extraction, one of the features of Azure AI Language, provides natural language processing. Given raw unstructured text, it can extract the most important phrases, analyze sentiment, and identify well-known entities such as brands. Together, these tools can help you quickly see what your customers are talking about and how they feel about it.
20
20
21
-
In this tutorial, you'll learn how to:
21
+
In this tutorial, you learn how to:
22
22
23
23
> [!div class="checklist"]
24
24
> * Use Power BI Desktop to import and transform data
@@ -40,7 +40,7 @@ In this tutorial, you'll learn how to:
40
40
To get started, open Power BI Desktop and load the comma-separated value (CSV) file that you downloaded as part of the [prerequisites](#prerequisites). This file represents a day's worth of hypothetical activity in a fictional small company's support forum.
41
41
42
42
> [!NOTE]
43
-
> Power BI can use data from a wide variety of web-based sources, such as SQL databases. See the [Power Query documentation](/power-query/connectors/) for more information.
43
+
> Power BI can use data from a wide variety of web-based sources, such as SQL databases. For more information, *see*[Power Query documentation](/power-query/connectors/).
44
44
45
45
In the main Power BI Desktop window, select the **Home** ribbon. In the **External data** group of the ribbon, open the **Get Data** drop-down menu and select **Text/CSV**.
46
46
@@ -50,15 +50,15 @@ The Open dialog appears. Navigate to your Downloads folder, or to the folder whe
The CSV import dialog lets you verify that Power BI Desktop has correctly detected the character set, delimiter, header rows, and column types. This information is all correct, so select **Load**.
53
+
The CSV import dialog lets you verify that Power BI Desktop correctly detected the character set, delimiter, header rows, and column types. This information is all correct, so select **Load**.
54
54
55
-
To see the loaded data, click the **Data View** button on the left edge of the Power BI workspace. A table opens that contains the data, like in Microsoft Excel.
55
+
To see the loaded data, select the **Data View** button on the left edge of the Power BI workspace. A table opens that contains the data, like in Microsoft Excel.
56
56
57
57

58
58
59
59
## Prepare the data
60
60
61
-
You might need to transform your data in Power BI Desktop before it's ready to be processed by Key Phrase Extraction.
61
+
You might need to transform your data in Power BI Desktop before Key Phrase Extraction processing.
62
62
63
63
The sample data contains a `subject` column and a `comment` column. With the Merge Columns function in Power BI Desktop, you can extract key phrases from the data in both these columns, rather than just the `comment` column.
64
64
@@ -68,7 +68,7 @@ In Power BI Desktop, select the **Home** ribbon. In the **External data** group,
68
68
69
69
Select `FabrikamComments` in the **Queries** list at the left side of the window if it isn't already selected.
70
70
71
-
Now select both the `subject` and `comment` columns in the table. You might need to scroll horizontally to see these columns. First click the `subject` column header, then hold down the Control key and click the `comment` column header.
71
+
Now select both the `subject` and `comment` columns in the table. You might need to scroll horizontally to see these columns. First select the `subject` column header, then hold down the Control key and select the `comment` column header.
72
72
73
73

74
74
@@ -82,7 +82,7 @@ You might also consider filtering out blank messages using the Remove Empty filt
82
82
83
83
## Understand the API
84
84
85
-
[Key Phrase Extraction](/rest/api/language/text-analysis-runtime/analyze-text?view=rest-language-2024-11-01&preserve-view=true&tabs=HTTP#analyzetextkeyphraseextractioninput) can process up to a thousand text documents per HTTP request. Power BI prefers to deal with records one at a time, so in this tutorial your calls to the API will include only a single document each. The Key Phrases API requires the following fields for each document being processed.
85
+
[Key Phrase Extraction](/rest/api/language/text-analysis-runtime/analyze-text?view=rest-language-2024-11-01&preserve-view=true&tabs=HTTP#analyzetextkeyphraseextractioninput) can process up to a thousand text documents per HTTP request. Power BI prefers to deal with records one at a time, so in this tutorial your calls to the API include only a single document each. The Key Phrases API requires the following fields for each document being processed.
86
86
87
87
| Field | Description |
88
88
| - | - |
@@ -92,10 +92,10 @@ You might also consider filtering out blank messages using the Remove Empty filt
92
92
93
93
## Create a custom function
94
94
95
-
Now you're ready to create the custom function that will integrate Power BI and Key Phrase Extraction. The function receives the text to be processed as a parameter. It converts data to and from the required JSON format and makes the HTTP request to the Key Phrases API. The function then parses the response from the API and returns a string that contains a comma-separated list of the extracted key phrases.
95
+
Now you're ready to create the custom function that integrates Power BI and Key Phrase Extraction. The function receives the text to be processed as a parameter. It converts data to and from the required JSON format and makes the HTTP request to the Key Phrases API. The function then parses the response from the API and returns a string that contains a comma-separated list of the extracted key phrases.
96
96
97
97
> [!NOTE]
98
-
> Power BI Desktop custom functions are written in the [Power Query M formula language](/powerquery-m/power-query-m-reference), or just "M" for short. M is a functional programming language based on [F#](/dotnet/fsharp/). You don't need to be a programmer to finish this tutorial, though; the required code is included below.
98
+
> Power BI Desktop custom functions are written in the [Power Query M formula language](/powerquery-m/power-query-m-reference), or just "M" for short. M is a functional programming language based on [F#](/dotnet/fsharp/). You don't need to be a programmer to finish this tutorial, though; the required code is included.
99
99
100
100
In Power BI Desktop, make sure you're still in the Query Editor window. If you aren't, select the **Home** ribbon, and in the **External data** group, select **Edit Queries**.
101
101
@@ -106,7 +106,7 @@ A new query, initially named `Query1`, appears in the Queries list. Double-click
106
106
Now, in the **Home** ribbon, in the **Query** group, select **Advanced Editor** to open the Advanced Editor window. Delete the code that's already in that window and paste in the following code.
107
107
108
108
> [!NOTE]
109
-
> Replace the example endpoint below (containing `<your-custom-subdomain>`) with the endpoint generated for your Language resource. You can find this endpoint by signing in to the [Azure portal](https://azure.microsoft.com/features/azure-portal/), navigating to your resource, and selecting **Key and endpoint**.
109
+
> Replace the following example endpoint (containing `<your-custom-subdomain>`) with the endpoint generated for your Language resource. You can find this endpoint by signing in to the [Azure portal](https://azure.microsoft.com/features/azure-portal/), navigating to your resource, and selecting **Key and endpoint**.
110
110
111
111
112
112
```fsharp
@@ -153,12 +153,12 @@ After you close the Invoke Custom Function dialog, a banner may appear asking yo
153
153
Select **Edit Credentials,** make sure `Anonymous` is selected in the dialog, then select **Connect.**
154
154
155
155
> [!NOTE]
156
-
> You select `Anonymous` because Key Phrase Extraction authenticates requests using your access key, so Power BI does not need to provide credentials for the HTTP request itself.
156
+
> You select `Anonymous` because Key Phrase Extraction authenticates requests using your access key, so Power BI doesn't need to provide credentials for the HTTP request itself.
157
157
158
158
> [!div class="mx-imgBorder"]
159
159
> 
160
160
161
-
If you see the Edit Credentials banner even after choosing anonymous access, you might have forgotten to paste your Language resource key into the code in the `KeyPhrases`[custom function](#create-a-custom-function).
161
+
If you see the Edit Credentials banner even after choosing anonymous access, you check to see if you pasted your Language resource key into the code in the `KeyPhrases`[custom function](#create-a-custom-function).
162
162
163
163
Next, a banner may appear asking you to provide information about your data sources' privacy.
164
164
@@ -170,20 +170,20 @@ Select **Continue** and choose `Public` for each of the data sources in the dial
170
170
171
171
## Create the word cloud
172
172
173
-
Once you have dealt with any banners that appear, select **Close & Apply** in the Home ribbon to close the Query Editor.
173
+
Once you address with any banners that appear, select **Close & Apply** in the Home ribbon to close the Query Editor.
174
174
175
175
Power BI Desktop takes a moment to make the necessary HTTP requests. For each row in the table, the new `keyphrases` column contains the key phrases detected in the text by the Key Phrases API.
176
176
177
-
Now you'll use this column to generate a word cloud. To get started, click the **Report** button in the main Power BI Desktop window, to the left of the workspace.
177
+
Now you use this column to generate a word cloud. To get started, select the **Report** button in the main Power BI Desktop window, to the left of the workspace.
178
178
179
179
> [!NOTE]
180
-
> Why use extracted key phrases to generate a word cloud, rather than the full text of every comment? The key phrases provide us with the *important* words from our customer comments, not just the *most common* words. Also, word sizing in the resulting cloud isn't skewed by the frequent use of a word in a relatively small number of comments.
180
+
> Why use extracted key phrases to generate a word cloud, rather than the full text of every comment? The key phrases provide us with the *important* words from our customer comments, not just the *most common* words. Also, word sizing in the resulting cloud doesn't correlate to the frequent use of a word in a relatively small number of comments.
181
181
182
-
If you don't already have the Word Cloud custom visual installed, install it. In the Visualizations panel to the right of the workspace, click the three dots (**...**) and choose **Import From Market**. If the word "cloud" is not among the displayed visualization tools in the list, you can search for "cloud" and click the **Add** button next the Word Cloud visual. Power BI installs the Word Cloud visual and lets you know that it installed successfully.
182
+
If you don't already have the Word Cloud custom visual installed, install it. In the Visualizations panel to the right of the workspace, select the three dots (**...**) and choose **Import From Market**. If the word "cloud" isn't among the displayed visualization tools in the list, you can search for "cloud" and select the **Add** button next the Word Cloud visual. Power BI installs the Word Cloud visual and lets you know that it installed successfully.
183
183
184
184
<br><br>
185
185
186
-
First, click the Word Cloud icon in the Visualizations panel.
186
+
First, select the Word Cloud icon in the Visualizations panel.
187
187
188
188

189
189
@@ -193,19 +193,19 @@ Now switch to the Format page of the Visualizations panel. In the Stop Words cat
Select the Focus Mode tool in the report to get a better look at our word cloud. The tool expands the word cloud to fill the entire workspace, as shown below.
200
+
Select the Focus Mode tool in the report to get a better look at our word cloud. The tool expands the word cloud to fill the entire workspace.
201
201
202
202

203
203
204
204
## Using other features
205
205
206
206
Azure AI Language also provides sentiment analysis and language detection. The language detection in particular is useful if your customer feedback isn't all in English.
207
207
208
-
Both of these other APIs are similar to the Key Phrases API. That means you can integrate them with Power BI Desktop using custom functions that are nearly identical to the one you created in this tutorial. Just create a blank query and paste the appropriate code below into the Advanced Editor, as you did earlier. (Don't forget your access key!) Then, as before, use the function to add a new column to the table.
208
+
Both of these other APIs are similar to the Key Phrases API. That means you can integrate them with Power BI Desktop using custom functions that are nearly identical to the one you created in this tutorial. Just create a blank query and paste the appropriate code into the Advanced Editor, as you did earlier. (Don't forget your access key!) Then, as before, use the function to add a new column to the table.
209
209
210
210
The Sentiment Analysis function below returns a label indicating how positive the sentiment expressed in the text is.
0 commit comments