Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi everybody,
I encountered a problem with Cognitive Services: Text Analysis.
I follow this document to get key phrases from text.
I use this code to bbuild the custom function:
// Returns key phrases from the text in a comma-separated list (text) => let apikey = "YOUR_API_KEY_HERE", endpoint = "https://westus.api.cognitive.microsoft.com/text/analytics/v2.1/keyPhrases", jsontext = Text.FromBinary(Json.FromValue(Text.Start(Text.Trim(text), 5000))), jsonbody = "{ documents: [ { language: ""en"", id: ""0"", text: " & jsontext & " } ] }", bytesbody = Text.ToBinary(jsonbody), headers = [#"Ocp-Apim-Subscription-Key" = apikey], bytesresp = Web.Contents(endpoint, [Headers=headers, Content=bytesbody]), jsonresp = Json.Document(bytesresp), keyphrases = Text.Lower(Text.Combine(jsonresp[documents]{0}[keyPhrases], ", ")) in keyphrases
It works OK as is (with language: ""en"") but I have the text in Czech so I need to chenge the language parameter to cs (which is ISO 6391 Name for Czech).
When I change it and I invoke the new column with function I get An error occurred in the ‘’ query. Expression.Error: There weren't enough elements in the enumeration to complete the operation.
When I chage language back to en it works OK but doesn't handle language correctly :-(.
Do you have any ideas?
Thank you.
Solved! Go to Solution.
Unfortunately it does not look like Czech is listed as currently supported the Key Phrases api
Unfortunately it does not look like Czech is listed as currently supported the Key Phrases api
OK, I didn't notice that document before.
Thank you, d_gosbell.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
144 | |
87 | |
65 | |
50 | |
45 |
User | Count |
---|---|
217 | |
88 | |
81 | |
65 | |
56 |