LuisRecognizer Class

public class LuisRecognizer
extends TelemetryRecognizer

Luis Recognizer class to query the LUIS Service using the configuration set by the LuisRecognizeroptions. A LUIS based implementation of TelemetryRecognizer.

Constructor Summary

Constructor Description
LuisRecognizer(LuisRecognizerOptions recognizerOptions)

Initializes a new instance of the Luis Recognizer.

Method Summary

Modifier and Type Method and Description
java.util.concurrent.CompletableFuture<T> <T>recognize(TurnContext turnContext, LuisRecognizerOptions recognizerOptions, Class<T> c)

Runs an utterance through a recognizer and returns a strongly-typed recognizer result.

java.util.concurrent.CompletableFuture<T> <T>recognize(TurnContext turnContext, LuisRecognizerOptions recognizerOptions, Map<String,String> telemetryProperties, Map<String,Double> telemetryMetrics, Class<T> c)

Runs an utterance through a recognizer and returns a strongly-typed recognizer result.

java.util.concurrent.CompletableFuture<T> <T>recognize(TurnContext turnContext, Class<T> c)

Runs an utterance through a recognizer and returns a strongly-typed recognizer result.

java.util.concurrent.CompletableFuture<T> <T>recognize(TurnContext turnContext, Map<String,String> telemetryProperties, Map<String,Double> telemetryMetrics, Class<T> c)

Runs an utterance through a recognizer and returns a strongly-typed recognizer result.

java.util.concurrent.CompletableFuture<T> <T>recognize(DialogContext dialogContext, Activity activity, LuisRecognizerOptions recognizerOptions, Class<T> c)

Runs an utterance through a recognizer and returns a strongly-typed recognizer result.

java.util.concurrent.CompletableFuture<T> <T>recognize(DialogContext dialogContext, Activity activity, LuisRecognizerOptions recognizerOptions, Map<String,String> telemetryProperties, Map<String,Double> telemetryMetrics, Class<T> c)

Runs an utterance through a recognizer and returns a strongly-typed recognizer result.

java.util.concurrent.CompletableFuture<T> <T>recognize(DialogContext dialogContext, Activity activity, Class<T> c)

Runs an utterance through a recognizer and returns a strongly-typed recognizer result.

java.util.concurrent.CompletableFuture<T> <T>recognize(DialogContext dialogContext, Activity activity, Map<String,String> telemetryProperties, Map<String,Double> telemetryMetrics, Class<T> c)

Runs an utterance through a recognizer and returns a strongly-typed recognizer result.

void onRecognizerResult(RecognizerResult recognizerResult, TurnContext turnContext, Map<String,String> telemetryProperties, Map<String,Double> telemetryMetrics)

Invoked prior to a LuisResult being logged.

java.util.concurrent.CompletableFuture<RecognizerResult> recognize(TurnContext turnContext)

Return results of the analysis (Suggested actions and intents).

java.util.concurrent.CompletableFuture<RecognizerResult> recognize(TurnContext turnContext, LuisRecognizerOptions recognizerOptions)

Return results of the analysis (Suggested actions and intents).

java.util.concurrent.CompletableFuture<RecognizerResult> recognize(TurnContext turnContext, LuisRecognizerOptions recognizerOptions, Map<String,String> telemetryProperties, Map<String,Double> telemetryMetrics)

Return results of the analysis (Suggested actions and intents).

java.util.concurrent.CompletableFuture<RecognizerResult> recognize(TurnContext turnContext, Map<String,String> telemetryProperties, Map<String,Double> telemetryMetrics)

Return results of the analysis (Suggested actions and intents).

java.util.concurrent.CompletableFuture<RecognizerResult> recognize(DialogContext dialogContext, Activity activity)

Return results of the analysis (Suggested actions and intents).

java.util.concurrent.CompletableFuture<RecognizerResult> recognize(DialogContext dialogContext, Activity activity, LuisRecognizerOptions recognizerOptions)

Return results of the analysis (Suggested actions and intents).

java.util.concurrent.CompletableFuture<RecognizerResult> recognize(DialogContext dialogContext, Activity activity, LuisRecognizerOptions recognizerOptions, Map<String,String> telemetryProperties, Map<String,Double> telemetryMetrics)

Return results of the analysis (Suggested actions and intents).

java.util.concurrent.CompletableFuture<RecognizerResult> recognize(DialogContext dialogContext, Activity activity, Map<String,String> telemetryProperties, Map<String,Double> telemetryMetrics)

Return results of the analysis (Suggested actions and intents).

static java.lang.String topIntent(RecognizerResult results)

Returns the name of the top scoring intent from a set of LUIS results.

static java.lang.String topIntent(RecognizerResult results, double minScore)

Returns the name of the top scoring intent from a set of LUIS results.

static java.lang.String topIntent(RecognizerResult results, String defaultIntent)

Returns the name of the top scoring intent from a set of LUIS results.

static java.lang.String topIntent(RecognizerResult results, String defaultIntent, double minScore)

Returns the name of the top scoring intent from a set of LUIS results.

Methods inherited from TelemetryRecognizer

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Constructor Details

LuisRecognizer

public LuisRecognizer(LuisRecognizerOptions recognizerOptions)

Initializes a new instance of the Luis Recognizer.

Parameters:

recognizerOptions - Luis Recognizer options to use when calling the LUIS Service.

Method Details

<T>recognize

public CompletableFuture recognize(TurnContext turnContext, LuisRecognizerOptions recognizerOptions, Class c)

Runs an utterance through a recognizer and returns a strongly-typed recognizer result.

Parameters:

turnContext - Context object containing information for a single turn of conversation with a user.
recognizerOptions - A LuisRecognizerOptions instance to be used by the call. This parameter overrides the default LuisRecognizerOptions passed in the constructor.
c - RecognizerConvert implemented class to convert the Recognizer Result into.

Returns:

The LUIS results of the analysis of the current message text in the current turn's context activity.

<T>recognize

public CompletableFuture recognize(TurnContext turnContext, LuisRecognizerOptions recognizerOptions, Map telemetryProperties, Map telemetryMetrics, Class c)

Runs an utterance through a recognizer and returns a strongly-typed recognizer result.

Parameters:

turnContext - Context object containing information for a single turn of conversation with a user.
recognizerOptions - A LuisRecognizerOptions instance to be used by the call. This parameter overrides the default LuisRecognizerOptions passed in the constructor.
telemetryProperties - Additional properties to be logged to telemetry with the LuisResult event.
telemetryMetrics - Additional metrics to be logged to telemetry with the LuisResult event.
c - RecognizerConvert implemented class to convert the Recognizer Result into.

Returns:

The LUIS results of the analysis of the current message text in the current turn's context activity.

<T>recognize

public CompletableFuture recognize(TurnContext turnContext, Class c)

Runs an utterance through a recognizer and returns a strongly-typed recognizer result.

Parameters:

turnContext - Context object containing information for a single turn of conversation with a user.
c - RecognizerConvert implemented class to convert the Recognizer Result into.

Returns:

The LUIS results of the analysis of the current message text in the current turn's context activity.

<T>recognize

public CompletableFuture recognize(TurnContext turnContext, Map telemetryProperties, Map telemetryMetrics, Class c)

Runs an utterance through a recognizer and returns a strongly-typed recognizer result.

Parameters:

turnContext - Context object containing information for a single turn of conversation with a user.
telemetryProperties - Additional properties to be logged to telemetry with the LuisResult event.
telemetryMetrics - Additional metrics to be logged to telemetry with the LuisResult event.
c - RecognizerConvert implemented class to convert the Recognizer Result into.

Returns:

The LUIS results of the analysis of the current message text in the current turn's context activity.

<T>recognize

public CompletableFuture recognize(DialogContext dialogContext, Activity activity, LuisRecognizerOptions recognizerOptions, Class c)

Runs an utterance through a recognizer and returns a strongly-typed recognizer result.

Parameters:

dialogContext - Context object containing information for a single turn of conversation with a user.
activity - Activity to recognize.
recognizerOptions - A LuisRecognizerOptions instance to be used by the call. This parameter overrides the default LuisRecognizerOptions passed in the constructor.
c - RecognizerConvert implemented class to convert the Recognizer Result into.

Returns:

The LUIS results of the analysis of the current message text in the current turn's context activity.

<T>recognize

public CompletableFuture recognize(DialogContext dialogContext, Activity activity, LuisRecognizerOptions recognizerOptions, Map telemetryProperties, Map telemetryMetrics, Class c)

Runs an utterance through a recognizer and returns a strongly-typed recognizer result.

Parameters:

dialogContext - Context object containing information for a single turn of conversation with a user.
activity - Activity to recognize.
recognizerOptions - LuisRecognizerOptions instance to be used by the call. This parameter overrides the default LuisRecognizerOptions passed in the constructor.
telemetryProperties - Additional properties to be logged to telemetry with the LuisResult event.
telemetryMetrics - Additional metrics to be logged to telemetry with the LuisResult event.
c - RecognizerConvert implemented class to convert the Recognizer Result into.

Returns:

The LUIS results of the analysis of the current message text in the current turn's context activity.

<T>recognize

public CompletableFuture recognize(DialogContext dialogContext, Activity activity, Class c)

Runs an utterance through a recognizer and returns a strongly-typed recognizer result.

Parameters:

dialogContext - Context object containing information for a single turn of conversation with a user.
activity - Activity to recognize.
c - RecognizerConvert implemented class to convert the Recognizer Result into.

Returns:

The LUIS results of the analysis of the current message text in the current turn's context activity.

<T>recognize

public CompletableFuture recognize(DialogContext dialogContext, Activity activity, Map telemetryProperties, Map telemetryMetrics, Class c)

Runs an utterance through a recognizer and returns a strongly-typed recognizer result.

Parameters:

dialogContext - Context object containing information for a single turn of conversation with a user.
activity - Activity to recognize.
telemetryProperties - Additional properties to be logged to telemetry with the LuisResult event.
telemetryMetrics - Additional metrics to be logged to telemetry with the LuisResult event.
c - RecognizerConvert implemented class to convert the Recognizer Result into.

Returns:

The LUIS results of the analysis of the current message text in the current turn's context activity.

onRecognizerResult

public void onRecognizerResult(RecognizerResult recognizerResult, TurnContext turnContext, Map telemetryProperties, Map telemetryMetrics)

Invoked prior to a LuisResult being logged.

Parameters:

recognizerResult - The Luis Results for the call.
turnContext - Context object containing information for a single turn of conversation with a user.
telemetryProperties - Additional properties to be logged to telemetry with the LuisResult event.
telemetryMetrics - Additional metrics to be logged to telemetry with the LuisResult event.

recognize

public CompletableFuture recognize(TurnContext turnContext)

Return results of the analysis (Suggested actions and intents).

Parameters:

turnContext - Context object containing information for a single turn of conversation with a user.

Returns:

The LUIS results of the analysis of the current message text in the current turn's context activity.

recognize

public CompletableFuture recognize(TurnContext turnContext, LuisRecognizerOptions recognizerOptions)

Return results of the analysis (Suggested actions and intents).

Parameters:

turnContext - Context object containing information for a single turn of conversation with a user.
recognizerOptions - A LuisRecognizerOptions instance to be used by the call. This parameter overrides the default LuisRecognizerOptions passed in the constructor.

Returns:

The LUIS results of the analysis of the current message text in the current turn's context activity.

recognize

public CompletableFuture recognize(TurnContext turnContext, LuisRecognizerOptions recognizerOptions, Map telemetryProperties, Map telemetryMetrics)

Return results of the analysis (Suggested actions and intents).

Parameters:

turnContext - Context object containing information for a single turn of conversation with a user.
recognizerOptions - LuisRecognizerOptions instance to be used by the call. This parameter overrides the default LuisRecognizerOptions passed in the constructor.
telemetryProperties - Additional properties to be logged to telemetry with the LuisResult event.
telemetryMetrics - Additional metrics to be logged to telemetry with the LuisResult event.

Returns:

The LUIS results of the analysis of the current message text in the current turn's context activity.

recognize

public CompletableFuture recognize(TurnContext turnContext, Map telemetryProperties, Map telemetryMetrics)

Return results of the analysis (Suggested actions and intents).

Parameters:

turnContext - Context object containing information for a single turn of conversation with a user.
telemetryProperties - Additional properties to be logged to telemetry with the LuisResult event.
telemetryMetrics - Additional metrics to be logged to telemetry with the LuisResult event.

Returns:

The LUIS results of the analysis of the current message text in the current turn's context activity.

recognize

public CompletableFuture recognize(DialogContext dialogContext, Activity activity)

Return results of the analysis (Suggested actions and intents).

Parameters:

dialogContext - Context object containing information for a single turn of conversation with a user.
activity - Activity to recognize.

Returns:

The LUIS results of the analysis of the current message text in the current turn's context activity.

recognize

public CompletableFuture recognize(DialogContext dialogContext, Activity activity, LuisRecognizerOptions recognizerOptions)

Return results of the analysis (Suggested actions and intents).

Parameters:

dialogContext - Context object containing information for a single turn of conversation with a user.
activity - Activity to recognize.
recognizerOptions - A LuisRecognizerOptions instance to be used by the call. This parameter overrides the default LuisRecognizerOptions passed in the constructor.

Returns:

The LUIS results of the analysis of the current message text in the current turn's context activity.

recognize

public CompletableFuture recognize(DialogContext dialogContext, Activity activity, LuisRecognizerOptions recognizerOptions, Map telemetryProperties, Map telemetryMetrics)

Return results of the analysis (Suggested actions and intents).

Parameters:

dialogContext - Context object containing information for a single turn of conversation with a user.
activity - Activity to recognize.
recognizerOptions - A LuisRecognizerOptions instance to be used by the call. This parameter overrides the default LuisRecognizerOptions passed in the constructor.
telemetryProperties - Additional properties to be logged to telemetry with the LuisResult event.
telemetryMetrics - Additional metrics to be logged to telemetry with the LuisResult event.

Returns:

The LUIS results of the analysis of the current message text in the current turn's context activity.

recognize

public CompletableFuture recognize(DialogContext dialogContext, Activity activity, Map telemetryProperties, Map telemetryMetrics)

Return results of the analysis (Suggested actions and intents).

Parameters:

dialogContext - Context object containing information for a single turn of conversation with a user.
activity - Activity to recognize.
telemetryProperties - Additional properties to be logged to telemetry with the LuisResult event.
telemetryMetrics - Additional metrics to be logged to telemetry with the LuisResult event.

Returns:

The LUIS results of the analysis of the current message text in the current turn's context activity.

topIntent

public static String topIntent(RecognizerResult results)

Returns the name of the top scoring intent from a set of LUIS results.

Parameters:

results - The Recognizer Result with the list of Intents to filter. Defaults to a value of "None" and a min score value of 0.0

Returns:

The top scoring intent name.

topIntent

public static String topIntent(RecognizerResult results, double minScore)

Returns the name of the top scoring intent from a set of LUIS results.

Parameters:

results - The Recognizer Result with the list of Intents to filter.
minScore - Minimum score needed for an intent to be considered as a top intent.

Returns:

The top scoring intent name.

topIntent

public static String topIntent(RecognizerResult results, String defaultIntent)

Returns the name of the top scoring intent from a set of LUIS results.

Parameters:

results - The Recognizer Result with the list of Intents to filter
defaultIntent - Intent name to return should a top intent be found. Defaults to a value of "None" and a min score value of 0.0

Returns:

The top scoring intent name.

topIntent

public static String topIntent(RecognizerResult results, String defaultIntent, double minScore)

Returns the name of the top scoring intent from a set of LUIS results.

Parameters:

results - The Recognizer Result with the list of Intents to filter
defaultIntent - Intent name to return should a top intent be found. Defaults to a value of "None
minScore - Minimum score needed for an intent to be considered as a top intent.

Returns:

The top scoring intent name.

Applies to