Recognizers in adaptive dialogs
APPLIES TO: SDK v4
Language recognizers let your bot interpret user input. Adaptive dialogs and language recognizers work together to interpret user intent and to react fluidly to user input. This article describes the builtin recognizers in the Bot Framework SDK and some of their key properties.
For information about how recognizer are used, see Language understanding in the Bot Framework Composer documentation.
Cross-trained recognizer set
The cross-trained recognizer set compares recognition results from more than one recognizer to decide a winner. Given a collection of recognizers, the cross-trained recognizer will:
- Promote the recognition result of one of the recognizers if all other recognizers defer recognition to a single recognizer. To defer recognition, a recognizer can return the
None
intent or an explicitDeferToRecognizer_recognizerId
as intent. - Raise an
OnChooseIntent
event to allow your code to choose which recognition result to use. Each recognizer's results are returned via theturn.recognized.candidates
property. This enables you to choose the most appropriate result.
Default recognizer
Note
Azure AI QnA Maker will be retired on 31 March 2025. Beginning 1 October 2022, you won't be able to create new QnA Maker resources or knowledge bases. A newer version of the question and answering capability is now available as part of Azure AI Language.
Custom question answering, a feature of Azure AI Language, is the updated version of the QnA Maker service. For more information about question-and-answer support in the Bot Framework SDK, see Natural language understanding.
Note
Language Understanding (LUIS) will be retired on 1 October 2025. Beginning 1 April 2023, you won't be able to create new LUIS resources. A newer version of language understanding is now available as part of Azure AI Language.
Conversational language understanding (CLU), a feature of Azure AI Language, is the updated version of LUIS. For more information about language understanding support in the Bot Framework SDK, see Natural language understanding.
The default recognizer was created to replace the following recognizers:
- LUIS recognizer - to extract intents and entities from a user's utterance based on the defined Language Understanding (LUIS) service.
- QnA Maker recognizer - to extract intents from a user's utterance based on the defined QnA Maker service.
- Cross-trained recognizer set - to compare recognition results from more than one recognizer to decide a winner.
LUIS recognizer
Language Understanding (LUIS) is a cloud-based API service that applies custom machine-learning intelligence to a user's conversational, natural language text to predict overall meaning, and pull out relevant, detailed information. The LUIS recognizer enables you to extract intents and entities from a user's utterance based on the defined LUIS application, which you train in advance.
Tip
For more information about how to incorporate language understanding into your bot using LUIS, see:
- Add LUIS for language understanding
- LUIS.ai is a machine learning-based service that enables you to build natural language capabilities into your bot.
- What is LUIS
- Language Understanding
- .lu file format
- Adaptive expressions
Multi-language recognizer
When building a sophisticated multi-lingual bot, you'll typically have one recognizer for each language and locale. The Multi-language recognizer enables you to easily specify the recognizer to use based on the locale property on the incoming activity from a user.
For more information, see the Multilingual support article in the Composer documentation.
Orchestrator recognizer
Orchestrator is a language understanding solution optimized for conversational AI applications. It replaces the Bot Framework Dispatcher. The Orchestrator recognizer enables you to extract an intent from a user's utterance, which could be used to route to an appropriate skill or recognizer, such as LUIS or QnA Maker.
Tip
For more information about how to incorporate language understanding into your bot using Orchestrator, see:
QnA Maker recognizer
QnAMaker.ai is one of the Azure AI services that enables you to create rich question-answer pairs from existing content - documents, URLs, PDFs, and so on. You can use the QnA Maker recognizer to integrate with the service.
Note
The QnA Maker recognizer will emit a QnAMatch
event, which you can handle with an OnQnAMatch
trigger.
The entire QnA Maker response will be available in the answer
property.
Recognizer set
Sometimes you might need to run more than one recognizer on every turn of the conversation. The recognizer set does exactly that. All recognizers are run on each turn of the conversation and the result is a union of all recognition results.
Regular expression (regex) recognizer
The Regex recognizer uses regular expressions to extract intent and entity data from an utterance.
The Regex recognizer consists primarily of:
Intents
. TheIntents
object contains a list ofIntentPattern
objects, and theseIntentPattern
objects consist of anIntent
property that is the name of the intent, and aPattern
property that contains a regular expression used to parse the utterance to determine intent.Entities
. TheEntities
object contains a list ofEntityRecognizer
objects. The Bot Framework SDK defines severalEntityRecognizer
classes to help you determine the entities contained in a user's utterance:AgeEntityRecognizer
ConfirmationEntityRecognizer
CurrencyEntityRecognizer
DateTimeEntityRecognizer
DimensionEntityRecognizer
EmailEntityRecognizer
EntityRecognizer
EntityRecognizerSet
GuidEntityRecognizer
HashtagEntityRecognizer
IpEntityRecognizer
MentionEntityRecognizer
NumberEntityRecognizer
NumberRangeEntityRecognizer
OrdinalEntityRecognizer
PercentageEntityRecognizer
PhoneNumberEntityRecognizer
RegExEntityRecognizer
TemperatureEntityRecognizer
TextEntity
TextEntityRecognizer
UrlEntityRecognizer
Tip
- The Regex recognizer emits a "None" intent when the input utterance doesn't match any defined intent. You can create an
OnIntent
trigger withIntent = "None"
to handle this scenario. - The Regex recognizer is useful for testing and quick prototyping. For more sophisticated bots we recommend using the Language Understanding (LUIS) recognizer.
- You might find the Regular expression language quick reference helpful.
Additional Information
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for