0

I am trying to get all the added utterances of a specific intent. Saw there is a method to review all labels against all intents, another one to add a label against an intent as said here. But could not find a method to get utterances of a single intent.

Tony Thomas
  • 398
  • 7
  • 20

1 Answers1

0

It doesn't seem that they gave us an endpoint with filtering possibilities.

Although not optimal we can still do that manually:

  1. Call the endpoint in your case this one.
  2. Create classes from the retrieved json (Rename the top level classes) enter image description here
  3. Deserialize the json and filter other objects.

And the code ;)

        var client = new HttpClient();
        client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", "{sub_key}");

        var uri = "your url" ;
        var json= await (await client.GetAsync(uri)).Content.ReadAsStringAsync();

        var filterValue = "Zabun";
        Utterance[] filteredUtterances = JsonConvert.DeserializeObject<Utterance[]>(json)
            .Where(v => v.IntentsResults.Name.Equals(filterValue)).ToArray();
Rinor
  • 1,790
  • 13
  • 22