Cognitive-services-speech-sdk: Receive identified Entities with the SDK

Created on 1 Oct 2019  路  4Comments  路  Source: Azure-Samples/cognitive-services-speech-sdk

In luis you can specify Entities.
Over the api you can receive the information if any entity was found, the entity and with what probability.
But atm you can't receive this information with the SDK.
#363

You could theoretically use Intents to filter the request but it wouldn't be practically:
For example if i would like the user to select something: select Product number 5.
i would ether have to create a Intent for every product i have... product 1 product 2 and so on, or i would have to analyse the spoken words again to look for the number(which could be 5, fifth, and so on).
Both Solutions would be quite complicated and unnecessary time consuming because luis does that already for me.
With entities i would get for example a List with one Entity{Number, 5} and would not have to look by myself.

It would be nice if you could add an option for a more detailed result to the IntentRecognizer, and then add a list with the found entities to the result. @jhakulin

Most helpful comment

Thanks for the new report.

From the Intent Recognition result (https://docs.microsoft.com/en-us/dotnet/api/microsoft.cognitiveservices.speech.intent.intentrecognitionresult?view=azure-dotnet) you should be able to get full JSON blob (from LUIS) from Properties of the result and using GetProperty method with LanguageUnderstandingServiceResponse_JsonResult property ID.

Let us know if this helps?

All 4 comments

Thanks for the new report.

From the Intent Recognition result (https://docs.microsoft.com/en-us/dotnet/api/microsoft.cognitiveservices.speech.intent.intentrecognitionresult?view=azure-dotnet) you should be able to get full JSON blob (from LUIS) from Properties of the result and using GetProperty method with LanguageUnderstandingServiceResponse_JsonResult property ID.

Let us know if this helps?

@jhakulin Thank you sooo much.
It麓s so nice to have access to the full result, but i would have never found this myself(super hidden)...

But it would be still very helpful if these Properties would be included/visible in the normal result...

P.s. the code for other people who might have a problem deciphering your instructions ;)

 private static void Recognizing(object sender, IntentRecognitionEventArgs e)
        {
            var temp = e.Result.Properties.GetProperty(PropertyId.LanguageUnderstandingServiceResponse_JsonResult);
        }

Thanks for verifying, I will close this

In python:

intent_result = intent_recognizer.recognize_once()
temp = intent_result.properties.get(speechsdk.PropertyId.LanguageUnderstandingServiceResponse_JsonResult)
Was this page helpful?
0 / 5 - 0 ratings