THE SINGLE GREATEST LEAP I have made with sentiment analysis occurred after using Microsoft's Cognitive Services. I'm diving into the API documentation by clicking on the navigation elements that appear after clicking on the image accompanying this post.
My first inkling of Microsoft Cognitive Services came while hearing about Project Oxford from Stephen Howell, a Microsoft academic evangelist. Stephen showed me a set of APIs, SDKs and services available to academics that injected greater intelligence into applications created by our third level students on the campus of the Limerick Institute of Technology.
Now Microsoft Cognitive Services have expanded on an evolving portfolio of machine learning APIs. With a little work, developers can easily add intelligent features such as
- emotion and video detection
- facial, speech and vision recognition
- speech and language understanding
All those features can be baked into applications, giving a more personal computing experience to the technology we create. This is more than theory. Cognitivie services are now part of the feature pack that we teach to advanced students, showing them how the systems they bild can see, hear, speak, understand and even begin to reason.
My first foray took me into the Academic Knowledge API. With it, I can interpret user queries for academic intent and retrieve rich information from the Microsoft Academic Graph (MAG). According to the documentation, "the MAG knowledge base is a web-scale heterogeneous entity graph comprised of entities that model scholarly activities: field of study, author, institution, paper, venue, and event".
MAG data is mined from the Bing web index as well as an in-house knowledge base from Bing. As a result of on-going Bing indexing, this API contains fresh information from the Web following discovery and indexing by Bing. Based on this dataset, the Academic Knowledge APIs enables a knowledge-driven, interactive dialog that seamlessly combines reactive search with proactive suggestion experiences, rich research paper graph search results, and histogram distributions of the attribute values for a set of papers and related entities.
The Academic Knowledge API consists of four related REST endpoints:
- interpret – Interprets a natural language user query string. Returns annotated interpretations to enable rich search-box auto-completion experiences that anticipate what the user is typing.
- evaluate – Evaluates a query expression and returns Academic Knowledge entity results.
- calchistogram – Calculates a histogram of the distribution of attribute values for the academic entities returned by a query expression, such as the distribution of citations by year for a given author.
- graph search – Searches for a given graph pattern and returns the matched entity results.
This is clever stuff because these API methods allow me to create a rich semantic search experience. The API takes my query string, runs it through the interpret method and returns with an annotated version of the query and a structured query expression. Most of the time, the API refactors my query based on the semantics of the underlying academic data and finds material I had not considered in my initial search strings. This tool is very powerful in helping to detect plagiarism and in helping to locate outliers based on their published research.
In the background, the API's graph search method uses two modes: json and lambda. The json mode can perform graph pattern matching according to the graph patterns specified by a JSON object. The lambda mode can perform server-side computations during graph traversals according to my user-specified lambda expressions. I'm having a nerdy time playing with the Microsoft Academic Graph.