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.
Asked
Active
Viewed 2,523 times
1 Answers
0
It doesn't seem that they gave us an endpoint with filtering possibilities.
Although not optimal we can still do that manually:
- Call the endpoint in your case this one.
- Create classes from the retrieved json (Rename the top level classes)
- 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