Forum Discussion
Azure Cognitive Services connection to Power BI
Hi, Cmoore
To connect to the EntityRecognition language service, you need to specify the kind parameter in your request body as EntityRecognition. This indicates that you are requesting the EntityRecognition language feature. You can also specify other input parameters, such as the language and the text to be analyzed by the Language service.
Perhaps you can use the following modification code to connect to the EntityRecognition language service:
(text) => let
apikey = "xxxxxxxxxxxxxx",
endpoint = https://xxxxxxxxxxxx.cognitiveservices.azure.com/language/:analyze-text?api-version=2023-04-01,
jsontext = Text.FromBinary(Json.FromValue(Text.Start(Text.Trim(text), 5000))),
jsonbody = "{ documents: [ { language: ""en"", id: ""0"", text: " & jsontext & " } ], kind: ""EntityRecognition"" }",
bytesbody = Text.ToBinary(jsonbody),
headers = [#"Ocp-Apim-Subscription-Key" = apikey],
bytesresp = Web.Contents(endpoint, [Headers=headers, Content=bytesbody]),
jsonresp = Json.Document(bytesresp),
doc=jsonresp[documents]{0},
result=doc[entities]
in #"result"
The kind parameter in the jsonbody variable is set to EntityRecognition. This might connect Power BI to the EntityRecognition language service and extract the corporate entity from the text provided.
How to Get Your Question Answered Quickly
Best Regards
Yongkang Hua
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you I will take a look. Over the weekend, I came across another end-point that is in use. Do you know the differences between;
https://xxxxxxxxx.cognitiveservices.azure.com/text/analytics/v2.1/entities and
https://xxxxxxxxx.cognitiveservices.azure.com/text/analytics/v3.1/entities/recognition/general
Is there one instance that we should use over another? When I'm looking through the Microsoft documentation I never see any such end points mentioned.
Thanks
Chris