Skip to content

Commit fdc8250

Browse files
authored
Merge pull request #89429 from aahill/ta-freshness
[Cognitive Services][Text Analytics] Updating tutorial endpoint
2 parents d435379 + 397a31b commit fdc8250

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed
7.38 KB
Loading
4.85 KB
Loading

articles/cognitive-services/text-analytics/tutorials/tutorial-power-bi-key-phrases.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,14 @@ A new query, initially named `Query1`, appears in the Queries list. Double-click
111111
Now, in the **Home** ribbon, in the **Query** group, click **Advanced Editor** to open the Advanced Editor window. Delete the code that's already in that window and paste in the following code.
112112

113113
> [!NOTE]
114-
> The examples below assume the Text Analytics API endpoint begins with `https://westus.api.cognitive.microsoft.com`. Text Analytics allows you to create a subscription in 13 different regions. If you signed up for the service in a different region, please make sure to use the endpoint for the region you selected. You can find this endpoint by signing in to the [Azure portal](https://azure.microsoft.com/features/azure-portal/), selecting your Text Analytics subscription, and selecting the Overview page.
114+
> Replace the example endpoint below (containing `<your-custom-subdomain>`) with the endpoint generated for your Text Analytics resource. You can find this endpoint by signing in to the [Azure portal](https://azure.microsoft.com/features/azure-portal/), selecting your Text Analytics subscription, and selecting `Quick start`.
115+
115116

116117
```fsharp
117118
// Returns key phrases from the text in a comma-separated list
118119
(text) => let
119120
apikey = "YOUR_API_KEY_HERE",
120-
endpoint = "https://westus.api.cognitive.microsoft.com/text/analytics/v2.1/keyPhrases",
121+
endpoint = "https://<your-custom-subdomain>.cognitiveservices.azure.com/text/analytics" & "/v2.1/keyPhrases",
121122
jsontext = Text.FromBinary(Json.FromValue(Text.Start(Text.Trim(text), 5000))),
122123
jsonbody = "{ documents: [ { language: ""en"", id: ""0"", text: " & jsontext & " } ] }",
123124
bytesbody = Text.ToBinary(jsonbody),
@@ -161,7 +162,8 @@ Click **Edit Credentials,** make sure `Anonymous` is selected in the dialog, the
161162
> [!NOTE]
162163
> You select `Anonymous` because the Text Analytics service authenticates you using your access key, so Power BI does not need to provide credentials for the HTTP request itself.
163164
164-
![[setting authentication to anonymous]](../media/tutorials/power-bi/access-web-content.png)
165+
> [!div class="mx-imgBorder"]
166+
> ![[setting authentication to anonymous]](../media/tutorials/power-bi/access-web-content.png)
165167
166168
If you see the Edit Credentials banner even after choosing anonymous access, you may have forgotten to paste your Text Analytics access key into the code in the `KeyPhrases` [custom function](#CreateCustomFunction).
167169

@@ -220,7 +222,7 @@ The Sentiment Analysis function below returns a score indicating how positive th
220222
// Returns the sentiment score of the text, from 0.0 (least favorable) to 1.0 (most favorable)
221223
(text) => let
222224
apikey = "YOUR_API_KEY_HERE",
223-
endpoint = "https://westus.api.cognitive.microsoft.com/text/analytics/v2.1/sentiment",
225+
endpoint = "https://<your-custom-subdomain>.cognitiveservices.azure.com" & "/text/analytics/v2.1/sentiment",
224226
jsontext = Text.FromBinary(Json.FromValue(Text.Start(Text.Trim(text), 5000))),
225227
jsonbody = "{ documents: [ { language: ""en"", id: ""0"", text: " & jsontext & " } ] }",
226228
bytesbody = Text.ToBinary(jsonbody),
@@ -237,7 +239,7 @@ Here are two versions of a Language Detection function. The first returns the IS
237239
// Returns the two-letter language code (for example, 'en' for English) of the text
238240
(text) => let
239241
apikey = "YOUR_API_KEY_HERE",
240-
endpoint = "https://westus.api.cognitive.microsoft.com/text/analytics/v2.1/languages",
242+
endpoint = "https://<your-custom-subdomain>.cognitiveservices.azure.com" & "/text/analytics/v2.1/languages",
241243
jsontext = Text.FromBinary(Json.FromValue(Text.Start(Text.Trim(text), 5000))),
242244
jsonbody = "{ documents: [ { id: ""0"", text: " & jsontext & " } ] }",
243245
bytesbody = Text.ToBinary(jsonbody),
@@ -251,7 +253,7 @@ in language
251253
// Returns the name (for example, 'English') of the language in which the text is written
252254
(text) => let
253255
apikey = "YOUR_API_KEY_HERE",
254-
endpoint = "https://westus.api.cognitive.microsoft.com/text/analytics/v2.1/languages",
256+
endpoint = "https://<your-custom-subdomain>.cognitiveservices.azure.com" & "/text/analytics/v2.1/languages",
255257
jsontext = Text.FromBinary(Json.FromValue(Text.Start(Text.Trim(text), 5000))),
256258
jsonbody = "{ documents: [ { id: ""0"", text: " & jsontext & " } ] }",
257259
bytesbody = Text.ToBinary(jsonbody),
@@ -271,7 +273,7 @@ Finally, here's a variant of the Key Phrases function already presented that ret
271273
// Returns key phrases from the text as a list object
272274
(text) => let
273275
apikey = "YOUR_API_KEY_HERE",
274-
endpoint = "https://westus.api.cognitive.microsoft.com/text/analytics/v2.1/keyPhrases",
276+
endpoint = "https://<your-custom-subdomain>.cognitiveservices.azure.com" & "/text/analytics/v2.1/keyPhrases",
275277
jsontext = Text.FromBinary(Json.FromValue(Text.Start(Text.Trim(text), 5000))),
276278
jsonbody = "{ documents: [ { language: ""en"", id: ""0"", text: " & jsontext & " } ] }",
277279
bytesbody = Text.ToBinary(jsonbody),

0 commit comments

Comments
 (0)