Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Knowledge Base

Definitive answers from Designer Desktop experts.

The 'How to Guide' to Cognitive Services Text Analytics Macro

JordanB
Alteryx
Alteryx
Created

The 'How to Guide' to Cognitive Services Text Analytics Macro

As Microsoft continues to grow it's Machine Learning capabilities, Alteryx is following suit and has built a new connector taking advantage of Microsoft's Cognitive Text Analytics API.

The new Cognitive Services Text Analytics Macro will replace the AzureML Text Analytics Macro, keeping sentiment analysis and key phrase extraction, while also adding Language and Topic detection.

To use this macro you will need to create a Microsoft Account, as well as signing up to theMicrosoft Azure Account.

Sign in or create a Microsoft Azure Account and this should take you to theAzure portal. You will need to click on 'Create a resource' and search for 'Text Analytics'.

1.PNG

You can then click 'create' in the bottom right corner.

You will need to set up asubscriptionsif you haven't already. Once you set up an account, you can return to this stage and continue.

Once you have set up a subscription you will be able tocreate an applicationby filling out the following window. Hot 'Create once you are finished and this prompt azure to deploy this application (This may take a minute - you should see it in the top right of the web browser).

3.PNG


You can then click on the notification tab and Pin to Dashboard then go to resource.

4.PNG

Once you have done this you should see the screen below: (If you don't please refresh or sign in & out of cognitive services untilyou see the information you added above within the information ribbonbelow).

5.PNG

Click on keys, then copy and Paste theminto the Cognitive ServicesMacro and select your field and type of text analysis.

Common Errors:

Error: Invalid subscription key

This error tends to occur because the account hasn't fully been processed by Microsoft.

Solution: Please log in & out of Azure, verify the information looks correct and then copy and paste the key into Alteryx.

Azure Error.png

Best,

Jordan Barker

Solutions Consultant

Comments
Joe_Lipski
13 - Pulsar
13 - Pulsar

Hi @JordanB the new process generates 2 keys and neither seem to work in the macro? Any advice?

Cheers,

Joe

JordanB
Alteryx
Alteryx

Hi @Joe_Lipski

 

Have you set this up on Azure dashboard as well? I went through the process of setting this up through the text Analytics website, but I also needed to set up Azure and sign up for a free account.

 

You should then be able to add the account (Screen below)

1.png

 

Once I made sure my account was Active and not Preview, I had to log in and out of the Azure dashboard site! The account then seem to take hold and I chose Key 1.

 

If you have just set up the account I would recommend logging in and out and using Key 1 again.

 

Keep me updated.

Joe_Lipski
13 - Pulsar
13 - Pulsar

@JordanB All working now! Think it was just a case of logging out and logging back in! Thanks!

nathan_fredette
6 - Meteoroid

@JordanB I get the error "The authorization type you provided is not supported. Only basic and OAuth are supported". My account shows active and both keys generate the same error. Any ideas? Thank you.
Capture.JPG

 

 

JordanB
Alteryx
Alteryx

Hi @nathan_fredette

 

Can you refresh (logoff) Azure on your webpage as we have seen the keys sometime take a while to take hold on the site. 

 

Can you then insert a new cognitive tool into the canvas and try again.

 

Best,

 

Jordan Barker

Solutions Consultant

jamielaird
14 - Magnetar

Thanks for this @JordanB 

 

It worked perfectly for me first time.

MichaelSu
Alteryx Alumni (Retired)

Hi Jordan,

 

It looks like Azure switched up the marketplace and I no longer see the text analytics API when I search? I've been digging and haven't been able to figure out the new workaround. Could you please advise?

 

Thanks,

Mike

 

@DillonA

@AshtonW

@ChadM

paulb1
8 - Asteroid

Michael, I was just trying to get this working today, and ran into the same issue myself.  Whenever I search for Cognitive Services APIs, the only thing I get in my results is Azure Search.  If anyone's got the fix, I'm in the market for it!

Joe_Lipski
13 - Pulsar
13 - Pulsar

Hi @MichaelSu & @paulb1

 

I was actually helping @Treyson with this at Inspire last week and you need to:

 

  1. Log into: https://portal.azure.com/
  2. Click Crete a Resource
  3. Search "Text Analytics"
  4. Click Create and then fill in the details
  5. It can take about 10 minutes for you key to become active so grab yourself a drink once you've created.

 

Hope that helps!

paulb1
8 - Asteroid

Thanks Joe, I was able to get it to work using Translator Text API.  Do you know what the difference is between the two?

Joe_Lipski
13 - Pulsar
13 - Pulsar

Not from an Azure stand point, but I know that you have the option to do Translation in the Alteryx macro, so I assume they probably use the same key - I don't know if the free limits or pricing are different but it might be worth investigating.

MichaelSu
Alteryx Alumni (Retired)

Yes, that did the trick. Thank you @Joe_Lipski !!

Treyson
13 - Pulsar
13 - Pulsar

Can confirm. @Joe_Lipski did help me last week. It was glorious.

JordanB
Alteryx
Alteryx

All the article has now been updated. Thanks Joe for the steps

 

 

HyunS
5 - Atom

Hi Jordan, 

 

Text Analytics API generated 2 keys but none of them seem to work even after logging in & out from the Azure Portal.

When I run the workflow in Alteryx, it returns the error like:
Error: Cognitive Services Text Translation (7): Tool #34: Iteration #1: Tool #57: The test "Bad API call - check API key" failed on record # 1

 

Any advice?

 

Thanks!

Cheers,

Hyun

Joe_Lipski
13 - Pulsar
13 - Pulsar

hi @HyunS - All working fine for me.

 

I think you may have to wait 10-15 minutes for the keys to become active, so hopefully it's working again now.

 

If not, make sure your Endpoint in Alteryx is set as westus as this stopped mine working once before.

 

Thanks,

Joe

JordanB
Alteryx
Alteryx

Hi @HyunS

 

@Joe_Lipski is right sometimes it takes a while for the keys to take hold. Keep us updated

 

Best,

 

Jordan

JonTurpin
5 - Atom

Hiya Jordan and Joe,

 

I'm having a similar issue to HyunS.

 

Have set endpoint as WestUS, have waited (reloaded and refreshed) for API keys to become active, but still no dice.

 

I don't know anything about creating macros, but a quick look under the hood shows that this is pointing to "https://api.microsofttranslator.com/V2/Http.svc/Detect" - that looks like an old URL... could this be the issue?

 

Keen to get any help you can provide!

 

Cheers,

Jon

JonTurpin
5 - Atom

(I suspect I may have found the issue, will update)

jnawrocki
5 - Atom

@JonTurpin

 

Any luck - as I am having the same issue...

JonTurpin
5 - Atom

Turns out I wanted to use the translation macro rather than the text analytics macro - they look similar in Azure, but are separate and generate different keys.

 

Might be what you need?

MichaelSu
Alteryx Alumni (Retired)

Hi All,

 

Wondering if anyone has had any issues with the API call receiving error message "Invalid value. at character position: 0"

 

The data we are trying to pass through is clean (data cleansing tool beforehand) and set to type VW String. I understand this may be more of a an API issue but wondering if anyone has had success working around it?

 

@BrandonB

 

invalid value character position.jpg

ladeby
5 - Atom

It does not work here. I'm getting the bad API call error. I put Location as North Europe instead of West US. Is that the issue? 

hoffm413
5 - Atom

Hi! 

 

Has there been any update on this? I set up the Azure piece of it this hours ago and I am still getting the following error.  Thanks 🙂

2019-09-11_15-46-03.png

JamesFo
8 - Asteroid
Hi Jordan & Joe, Thanks for this really useful how to guide. I've been though the process you've described above, and I'm getting the error "couldn't resolve hostname". Have you come across this one before? My API key & endpoint that I am using in Alteryx match those stated on the quick start page on the Azure resource I have created (but I've also tried it with "UK South", which it mentions as my location on the same page). Only passing 100 lines, and the column I am passing is set-up as a V_WString data type. Many thanks, James (A brand new Alteryx user) p.s. Apologies - I can't see how to upload a picture with screenshots!
JamesFo
8 - Asteroid
All - just a follow up. If you are trying to use a location that is not listed in the drop down for Endpoint this is still possible, you just need to make sure to remove the space (eg "UK South" becomes "UKSouth"). Hope that is helpful to someone.
Joe_Lipski
13 - Pulsar
13 - Pulsar

Hi @mahinouralaa - That looks like a different tool, you should download and use this one, which I've checked still works fine for me: https://gallery.alteryx.com/#!app/Microsoft-Cognitive-Services-Text-Analytics/5d926c92826fd30b845378...

Joe_Lipski
13 - Pulsar
13 - Pulsar

I'd suggest trying to get in touch with Peter on the link you've listed and hopefully he can help.

 

Otherwise do try the link I posted which is the macro that this blog talks about as that does work. Is there a reason why you don't want to use it?

joesparty
8 - Asteroid

Hi @JordanB and @Joe_Lipski 

 

Have you come across this error?

Error: Cognitive Services Text Analytics (85): Tool #192: e2 does not yet support the Throttle tool.

 

I've use a select record tool to pass 1 record and select tool to pass one field.

 

Cheers!

Joe_Lipski
13 - Pulsar
13 - Pulsar

Hi @joesparty,

 

I think all you should need to do is uncheck the 'Use AMP Engine' button in your workflow configuration settings:

 

Joe_Lipski_0-1655923963945.png

 

You will probably also need to do this in the macro, so right click on the tool, open as macro and then uncheck it there and save it.

 

Hopefully, that should do the trick.

 

AMP Engine and e2 are the same thing and you can read the specifics about it here: https://help.alteryx.com/20221/designer/alteryx-amp-engine

 

joesparty
8 - Asteroid

@Joe_Lipski that did resolve that issue!  I have created a Translator service and tried both free and pay as you go without luck. Any thoughts as to what else I could try?

 

Error: Cognitive Services Text Analytics (2): Tool #76: Microsoft API error... HTTP/1.1 401 {"error":{"code":"401","message": "The Detect Language Operation under Text Analytics API (v2.0) is not supported with the current subscription key and pricing tier TextTranslator.S1."}}

 

Did the Microsoft Cognitive Services replace the Text Translator?

harvjul
8 - Asteroid

@joesparty were you able to resolve the error?  I have the same error. 

Error: Cognitive Services Text Analytics (6): Tool #76: Microsoft API error... HTTP/1.1 401 {"error":{"code":"401","message": "The Detect Language Operation under Text Analytics API (v2.0) is not supported with the current subscription key and pricing tier TextTranslator.F0."}}

joesparty
8 - Asteroid

@harvjul sorry no.