Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
100 | |
80 | |
64 | |
57 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |