Microsoft Text Analysis only returns 0?

text
cognitive
microsoft

#1

I am trying to get a very basic idea of how the cognitive services activities that are included in Studio are utilized. I have a key for Microsoft’s text analytics API and I have created a sequence which only contains a MS Text Analysis activity and a Write line activity. I then simply enter a string into the text property for MS Text Analysis and have it write the sentiment score with the write line activity. The problem I am seeing is I am getting the same score of 0 for the phrase “I love you” as well as “I hate you” which is obviously incorrect. Is there something I am missing? I did check the forum for other threads and only saw one tutorial thread but the example posted in there doesn’t work. Has anyone else run into this issue?


Microsoft Text Analysis always shows always 0
#2

Hi,

It works well in my environment.
Can you check if “Analysis Type” - “Sentiment” property is checked?

Regards,


#3

MSCognitiveTest.xaml (5.0 KB)

Attached is my simple sample I am testing, I just removed my key from the key property so you will have to supply your own. Is there something I am doing incorrectly? I can confirm that I have the Sentiment option checked in the Analysis Type section. They key I am using is from Microsoft’s Text Analytics API.


#4

Hi,

I tried your scenario with my API key and got 0.996528148651123 as Sentiment.
(It works on UiPath CE 2017.1.6435 with Cognitive Package 1.0.6383.17974 and 1.0.6239.28764.)
So, your scenario seems good.

SentimentValue

It may be caused by your environment or your API key.
Can you check them?

Regards,


#5

Hey Yoichi,
So my colleague let me use one of his old Cognitive Services keys and that worked so I am thinking there is something wrong with me key. In your azure portal where you manage your Cognitive Services keys what endpoint are you using and do you input that link in the URL property box in UiPath?

Thanks!
Christian


#6

Hi,
I’ll share my setting for Azure Text Analytics API as the following image.

I used “KEY 1” in “Manage Keys” section and left the Service URL property in the activity blank.

Regards,


#7

Thanks Yoichi, I will change my location to see if that fixes anything.


#8

Hi @cvent978

If you API location is not WestUS, you need to fill your Endpoint URL to ServiceUrl property.
For example, if your location is SoutheastAsia, you can fill “https://southeastasia.api.cognitive.microsoft.com/text/analytics/v2.0/”.
You may need to add ‘/’ at the end of URL string, because the URL string which we can get from Azure Portal doesn’t end ‘/’.

Regards,


#9

Changing my location to WestUS seemed to fix the problem! My key is now working, I really appreciate all your help Yoichi. Thanks!