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

Interpreting natural language queries

The query expressions the API expects to evaluate a query are not in a natural language format. To ensure that users can make queries in a natural way, we need to interpret their input.

When calling the Interpret feature of the API, it accepts a query string. This will be returned, formatted to reflect the user intent, using academic grammar. In addition, this feature can be called as the user is writing, to provide an interactive experience.

The request is a GET request:

 private async void Interpret(object obj) { var queryString = HttpUtility.ParseQueryString(string.Empty); queryString["query"] = InputQuery; queryString["complete"] = "1"; //queryString["count"] = "10"; //queryString["offset"] = "0"; ...

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