cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
runski Frequent Visitor
Frequent Visitor

Enterprise Gateway and Text Analytics

Hi.

Can someone guide me on how to set up a connection to Text Analytics API using the Enterprise Gateway?

Thanks.

5 REPLIES 5
Super User
Super User

Re: Enterprise Gateway and Text Analytics

Assuming that you are referring to the Text Analytics API in the Azure Data Marketplace, in looking at this article: 

 

https://azure.microsoft.com/en-us/documentation/articles/machine-learning-apps-text-analytics/

 

I would think that what you need to do is implement this in "M" code. Is that what you are doing?


I have book! Learn Power BI from Packt


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

ivargjerde Frequent Visitor
Frequent Visitor

Re: Enterprise Gateway and Text Analytics

We implemented the API in a Blank Query using the following code

 

(Source as table) as any =>
let
    JsonRecords = Text.FromBinary(Json.FromValue(Source)),
    JsonRequest = "{""documents"": " & JsonRecords & "}",
 
    JsonContent = Text.ToBinary(JsonRequest, TextEncoding.Ascii),
    Response =
        Web.Contents("https://westus.api.cognitive.microsoft.com/text/analytics/v2.0/sentiment",
            [
                Headers = [#"Ocp-Apim-Subscription-Key"= "Our API key",
                           #"Content-Type"="application/json", Accept="application/json"],
                Content=JsonContent
            ]),
    JsonResponse = Json.Document(Response,1252)
in
    JsonResponse

 

We then call the Query from a table that contains the text we want to analyze. The text comes from our on-premise SQL server that we connect to through the Enterprise data gateway. When we try to enable refresh on the dataset we get the following error.

 

Something went wrong.
 
Failed to use the selected gateway. Please make sure the gateway is up and running and try again.
Please try again later or contact support. If you contact support, please provide these details.
Activity ID84912326-5530-51de-9f1b-04c74b35d761
Request IDf3a597ca-2144-5f1c-9b80-623075143a83
Correlation ID1422aa44-c7bc-1602-688c-872d0c2b6f0a
Status code400
TimeMon Oct 17 2016 10:52:42 GMT+0200 (Central European Daylight Time)
Version13.0.1700.374
 
If we delete the table that calls the query and republish the model refresh works fine. Any input on where we might be going wrong would be greatly appreciated!

 

 

Moderator v-caliao-msft
Moderator

Re: Enterprise Gateway and Text Analytics

Hi @runski,

 

As Smoupre said, do you use API on the link below?

https://azure.microsoft.com/en-us/documentation/articles/cognitive-services-text-analytics-quick-sta...

 

Please provide us more details about what you have done, so that we can make further analysis.

 

Regards,

Charlie Liao

 

ivargjerde Frequent Visitor
Frequent Visitor

Re: Enterprise Gateway and Text Analytics

Hi @v-caliao-msft@Greg_Deckler,

 

 

 

I work together with @runski. My post above explains our implementation approach and the error message the we see when we try to refresh our data using the Enterprise Gateway.

 

We do use the API from Microsoft Azure in the link provided by @v-caliao-msft.

 

We followed the method outlined in these blog posts. The only difference is that the text we analyse come from our on-premise SQL server instead of from Facebook.

 

http://community.powerbi.com/t5/Community-Blog/Sentiment-Analysis-in-Power-BI/ba-p/55898

http://datachant.com/2016/08/09/sentiment-analysis-power-bi-part-2/

 

 

Yesterday, we tried connecting to the .pibx file stored in OneDrive as opposed to publishing it to the Power BI Service. We were not able to refresh the data using this approach either.

 

 

Regards,

Ivar

wwright1984 Frequent Visitor
Frequent Visitor

Re: Enterprise Gateway and Text Analytics

I'm getting this as well it's very frustrating, has anyone found a work around or a fix yet?

 

{ "statusCode": 404, "message": "Resource not found" } when using the URL

https://westus.api.cognitive.microsoft.com/text/analytics/v2.0

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 394 members 3,774 guests
Please welcome our newest community members: