共用方式為


IntentRecognizer.RecognizeOnceAsync Method

Definition

Overloads

RecognizeOnceAsync()

Starts speech recognition with intent recognition as an asynchronous operation.

RecognizeOnceAsync(String)

Performs intent recognition, and generates a result from the text passed in. This is useful for testing and other times when the speech input is not tied to the IntentRecognizer. Note: The Intent Service does not currently support this so it is only valid for offline pattern matching or exact matching intents.

RecognizeOnceAsync()

Starts speech recognition with intent recognition as an asynchronous operation.

public System.Threading.Tasks.Task<Microsoft.CognitiveServices.Speech.Intent.IntentRecognitionResult> RecognizeOnceAsync ();
member this.RecognizeOnceAsync : unit -> System.Threading.Tasks.Task<Microsoft.CognitiveServices.Speech.Intent.IntentRecognitionResult>
Public Function RecognizeOnceAsync () As Task(Of IntentRecognitionResult)

Returns

A task representing the recognition operation. The task returns a value of IntentRecognitionResult

Remarks

The end of a single utterance is determined by listening for silence at the end, or until a timeout period has elapsed. The task returns the intent in IntentId and the recognized speech in TranslationRecognitionResult.Text. Intents are defined in the LUIS model or through an AddIntent(String) or AddIntent(String, String)method.

You can call StopContinuousRecognitionAsync() to stop recognition before an intent has been recognized.

Since this method returns only a single utterance, it is suitable only for single shot recognition like command or query. For long-running multi-utterance recognition, use StartContinuousRecognitionAsync() instead.

See also: Get started with intent recognition

Applies to

RecognizeOnceAsync(String)

Performs intent recognition, and generates a result from the text passed in. This is useful for testing and other times when the speech input is not tied to the IntentRecognizer. Note: The Intent Service does not currently support this so it is only valid for offline pattern matching or exact matching intents.

public System.Threading.Tasks.Task<Microsoft.CognitiveServices.Speech.Intent.IntentRecognitionResult> RecognizeOnceAsync (string text);
member this.RecognizeOnceAsync : string -> System.Threading.Tasks.Task<Microsoft.CognitiveServices.Speech.Intent.IntentRecognitionResult>
Public Function RecognizeOnceAsync (text As String) As Task(Of IntentRecognitionResult)

Parameters

text
String

The text to be recognized for intent.

Returns

A task representing the recognition operation. The task returns a value of IntentRecognitionResult

Applies to