O'Reilly logo

Learning Microsoft Cognitive Services - Second Edition by Leif Larsen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Calculating the distribution of attributes from academic entities

Another feature of the Academic API is the possibility to calculate the distribution of attribute values for a set of paper entities. This can be done by calling the calchistogram API endpoint.

This is a GET request, so we start by creating a query string:

    string queryString = $"expr={QueryExpression}&attributes=Y,F.FN"; 
 
    //queryString += "&model=latest"; 
    //queryString += "&count=10"; 
    //queryString += "&offset=0"; 

The parameters we can specify are the same as with Evaluate, except we do not have the orderby parameter. For this call, we want to get the year of publication (Y) and the field of study name (F.FN).

We make the call to the API, not specifying any request bodies: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required