Reputation: 91
I need to retrieve all the labeled utterances (aka examples) for a particular intent.
It appears the only call in the LUIS Authoring API to do this is GET review labeled examples:
/luis/api/v2.0/apps/:appId/versions/:versionId/examples?skip=0&take=500
/luis/api/v2.0/apps/:appId/versions/:versionId/examples?skip=500&take=500
This returns all utterances for all intents. I have 880 labeled utterances, and due to the verbose reply, it's a 2.5MB file. This makes it slow.
The LUIS web UI uses a filtered call:
/luis/webapi/v2.0/apps/:appId/versions/0.1/models/:modelId/reviewLabels
. The resulting file is usually 10-50kB. However, there is no documentation around this call (notice the webapi
in the path rather than just api
).
So: is there a supported method for retrieving a filtered list of utterances?
Upvotes: 2
Views: 639
Reputation: 16652
is there a supported method for retrieving a filtered list of utterances?
AFAIK, I could't find an API for this from server side, after research I found that even the Luis Web UI doesn't use any filter provided by server, it just gets all the utterances from server side and create filter use js in the foreground.
Since you're stratified with the result using webapi
for Luis Web UI, after testing, we can call this webapi
exactly the same as calling api
together with Ocp-Apim-Subscription-Key
as head, for example we can code like this in C#:
try
{
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", "{SubscriptionKey}");
var uri = "https://westus.api.cognitive.microsoft.com/luis/webapi/v2.0/apps/{appId}/versions/{versionNumber}/models/{modelId}/reviewLabels";
var response = await client.GetAsync(uri);
//TODO:
}
}
catch (Exception e)
{
Debug.WriteLine(e.Message);
}
There's no official document about this webapi
, but we can try to use Postman
to analyse the http requests.
Upvotes: 4