Sample project in .NET to deserialize the elements of MS LUIS v3 prediction endpoint JSON

Is there a sample project in c#.Net to deserialize the V3 prediction endpoint json containing different types of entities like builtin entities, list entities and pattern entities. I am facing major issue while deserializing and extracting the data and values from builtin.dateTimeV2 entities. Please help me out with this asap as we need it to be done in our project asap.

Please find the MS reference links below: https://docs.microsoft.com/en-us/azure/cognitive-services/luis/luis-migration-api-v3

https://docs.microsoft.com/en-us/azure/cognitive-services/luis/luis-reference-prebuilt-datetimev2?tabs=1-1%2C2-2%2C3-1%2C4-1%2C5-2%2C6-1#date-range-resolution-examples-for-day-of-week

https://docs.microsoft.com/en-us/azure/cognitive-services/luis/luis-get-started-get-intent-from-rest?pivots=programming-language-csharp

I need the solution for this in .Net to extract all the type, timex, resolution values etc. of entities and intents.

Please find the Json samples(especially the builtin.dateTimeV2) below:

Json1: "entities":{"datetimeV2":[{"type":"date","values":[{"timex":"2020-11-23","resolution":[{"value":"2020-11-23"}]}]}],"$instance":{"datetimeV2":[{"type":"builtin.datetimeV2.date","text":"tomorrow","startIndex":19,"length":8,"modelTypeId":2,"modelType":"Prebuilt Entity Extractor","recognitionSources":["model"]}]}

Json2: "entities":{"datetimeV2":[{"type":"datetime","values":[{"timex":"2020-11-23T09","resolution":[{"value":"2020-11-23 09:00:00"}]}]}],"$instance":{"datetimeV2":[{"type":"builtin.datetimeV2.datetime","text":"tomorrow morning 9am","startIndex":19,"length":20,"modelTypeId":2,"modelType":"Prebuilt Entity Extractor","recognitionSources":["model"]}]}

Json3: "datetimeV2":[{"type":"daterange","values":[{"timex":"XXXX-06","resolution":[{"start":"2020-06-01","end":"2020-07-01"},{"start":"2021-06-01","end":"2021-07-01"}]}]}],"$instance":{"datetimeV2":[{"type":"builtin.datetimeV2.daterange","text":"june","startIndex":20,"length":4,"modelTypeId":2,"modelType":"Prebuilt Entity Extractor","recognitionSources":["model"]}]

Json4: "entities":{"datetimeV2":[{"type":"daterange","values":[{"timex":"2020","mod":"end","resolution":[{"start":"2020-07-01","end":"2021-01-01"}]}]}],"$instance":{"datetimeV2":[{"type":"builtin.datetimeV2.daterange","text":"end of year","startIndex":0,"length":11,"modelTypeId":2,"modelType":"Prebuilt Entity Extractor","recognitionSources":["model"]}],

Please help with these asap.



Read more here: https://stackoverflow.com/questions/64952224/sample-project-in-net-to-deserialize-the-elements-of-ms-luis-v3-prediction-endp

Content Attribution

This content was originally published by GDeep-09 at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: