← Back to Tutorials Chapter 10

Conversational Language Understanding

CLU Overview: Evolution from LUIS to CLU

Conversational Language Understanding (CLU) is the Azure AI service that extracts meaning from natural language inputs. It identifies what the user wants to do (the intent) and the key pieces of information in what they said (the entities). CLU is the successor to LUIS (Language Understanding Intelligent Service), which Microsoft retired in 2025. All new projects should use CLU, and existing LUIS applications must be migrated to CLU.

CLU offers significant improvements over LUIS. It uses transformer-based models that understand context better than LUIS's earlier neural network architecture. It provides a unified platform within Azure AI Language Studio, consolidating CLU, custom text classification, and custom NER into a single workspace. CLU also supports multiple languages in a single project (a feature LUIS lacked), and it integrates natively with Azure AI Bot Service and the Bot Framework SDK.

On the AI-102 exam, CLU appears in both the "Implement natural language processing" and "Implement conversational AI" domains. You should understand the CLU project lifecycle: creating a project, defining intents and entities, providing example utterances, training, evaluating, deploying, and consuming via the API. Also know the differences between LUIS and CLU, as exam questions may reference both.

Understanding Intents, Entities, and Utterances

Three core concepts form the foundation of every CLU project. Intents represent the goal or purpose of the user's input. Examples include "BookFlight," "CheckWeather," "OrderCoffee," or "CancelReservation." Every project includes a required "None" intent that captures utterances that do not match any of your defined intents. A well-trained "None" intent is critical — it prevents your application from trying to process irrelevant inputs as valid commands.

Entities are pieces of information in the user's utterance that are relevant to fulfilling the intent. For a "BookFlight" intent, entities might include destination city, departure date, number of passengers, and ticket class. CLU supports prebuilt entities (like numbers, dates, and geography) and custom entities that you define (like product names or room types). Entities can be learned (the model extracts them from context) or list-based (exact match against a predefined list of values).

Utterances are example phrases that show how users express a given intent. You provide 10-15 or more utterances per intent during training. Each utterance should represent a realistic variation of how users might phrase that intent. The more variety you include in terms of word choice, sentence structure, and length, the better your model generalizes.

ConceptDefinitionExample
IntentThe user's goal or purpose"OrderCoffee"
UtteranceAn example phrase expressing the intent"I'd like a large latte with oat milk, please"
EntityA data point extracted from the utteranceSize: "large", DrinkType: "latte", MilkType: "oat milk"

The "None" intent is often the most neglected but is the most important for production quality. Include 10-15 utterances that represent things users might say that are out of scope for your application. Common "None" utterances include greetings ("hello," "hi"), farewells ("goodbye," "thanks"), irrelevant questions ("what's the weather like?"), and gibberish ("asdfgh"). Without a strong "None" intent, your model will try to fit irrelevant inputs into your other intents, causing confusion for users.

Creating a CLU Project in Language Studio

To create a CLU project, navigate to language.cognitive.azure.com, select the Language resource you want to use, and click on "Conversational Language Understanding" under the "Understand questions and conversational language" section. Click "Create new project," provide a name like "CoffeeShopBot," select the primary language (English), and choose whether to enable multiple languages. Multi-language support allows the same project to process utterances in different languages, but you must provide training utterances in each language you want to support.

After project creation, the Language Studio workspace opens with sections for Schema Definition (intents and entities), Data Labeling (utterances), Training, Evaluation, and Deployment. The schema definition step is where you list all intents and entity types before you start labeling utterances.

Adding Intents and Labeling Entities

Start by defining your intents. For a coffee shop ordering system, you might define: OrderCoffee, CheckMenu, GetStoreHours, CancelOrder, and None. Each intent needs a descriptive name that follows a PascalCase or camelCase convention. Avoid overly broad intents — "HandleOrder" that encompasses ordering, modifying, and canceling is too broad and will confuse the model.

Next, define your entities. For the coffee shop, entities might include DrinkType (espresso, latte, cappuccino, mocha), Size (small, medium, large), Quantity (a prebuilt number entity), Modifications (oat milk, extra shot, decaf), and Temperature (hot, iced, blended). You can mark entities as "required" for a specific intent, which helps the model understand which entities must be present to fulfill the intent.

After defining the schema, add utterances for each intent. Type or paste natural phrases that a customer might say. For each utterance, select the text spans that correspond to your entities and assign the entity type. Language Studio's labeling interface shows the utterance with highlighted entity spans, making it easy to verify labeling consistency.

Sample utterances for "OrderCoffee" intent:
"Can I get a medium latte please?"
"I'd like a large cappuccino with an extra shot"
"One small espresso, to go"
"Could I order a grande iced mocha with oat milk?"
"A tall hot chocolate with whipped cream"
"Can I have two medium caramel macchiatos?"

After labeling, utterances for "OrderCoffee" would have DrinkType, Size, Quantity, and Modifications entities highlighted. For example, in "I'd like a large cappuccino with an extra shot," "large" is labeled as Size, "cappuccino" as DrinkType, and "extra shot" as Modifications.

Training and Evaluating a CLU Model

When you have at least 10 utterances per intent (15 is recommended), click the "Train" button in Language Studio. The training process splits your utterances into training and testing sets. CLU uses a cross-validation approach where the model is trained on a subset of utterances and tested on the held-out portion. After training completes, Language Studio displays evaluation metrics.

The primary metric for CLU evaluation is the F1 score, calculated separately for intents and entities. The intent F1 measures how accurately the model predicts the correct intent. The entity F1 measures how accurately the model extracts entity spans and assigns the correct entity type. A combined F1 score aggregates both. For production-ready applications, aim for an F1 score above 0.85 on both intents and entities.

The test results page shows a confusion matrix for intents, allowing you to see which intents are commonly confused with each other. If "OrderCoffee" and "CheckMenu" utterances are frequently confused, your training utterances may not distinguish them clearly enough. Add more distinctive utterances that emphasize the differences.

Exam Tip: LUIS vs. CLU

The AI-102 exam includes comparison questions between LUIS and CLU. Key differences: CLU uses transformer-based models while LUIS used older neural networks. CLU supports multiple languages in one project, LUIS required separate apps per language. CLU is part of Azure AI Language Studio alongside custom text classification and NER, while LUIS had its own portal at luis.ai. CLU uses a unified authoring and prediction API, while LUIS had separate authoring and prediction APIs. CLU supports active learning through reviewing endpoint utterances. All LUIS applications are being retired — if a question mentions building a new language understanding application, the answer should always be CLU.

Deploying CLU as a Prediction Endpoint

After training and evaluation, deploy the model to make it available for prediction. CLU supports deployment slots similar to custom text models. Create a staging slot for testing and a production slot for live traffic. Each deployment has a unique endpoint URL that includes the project name and deployment slot.

To call the CLU endpoint programmatically, use the Azure AI Language SDK with the project and deployment name parameters. The following Python example shows how to predict intents and entities from a user utterance:

import os
from azure.core.credentials import AzureKeyCredential
from azure.ai.language.conversations import ConversationAnalysisClient

endpoint = os.environ["LANGUAGE_ENDPOINT"]
key = os.environ["LANGUAGE_KEY"]
project_name = "CoffeeShopBot"
deployment_name = "production"

client = ConversationAnalysisClient(
    endpoint=endpoint,
    credential=AzureKeyCredential(key)
)

utterance = "I'd like a large cappuccino with oat milk, please"

response = client.analyze_conversation(
    task={
        "kind": "Conversation",
        "analysisInput": {
            "conversationItem": {
                "id": "1",
                "text": utterance,
                "modality": "text"
            }
        },
        "parameters": {
            "projectName": project_name,
            "deploymentName": deployment_name
        }
    }
)

result = response["result"]
top_intent = result["prediction"]["topIntent"]
confidence = result["prediction"]["intents"][0]["confidenceScore"]

print(f"Utterance: {utterance}")
print(f"Top intent: {top_intent} ({confidence:.2%})")

if "entities" in result["prediction"]:
    for entity in result["prediction"]["entities"]:
        print(f"  Entity: {entity['text']} -> {entity['category']} "
              f"({entity['confidenceScore']:.2%})")
// C# - calling CLU endpoint
using Azure;
using Azure.AI.Language.Conversations;

var endpoint = Environment.GetEnvironmentVariable("LANGUAGE_ENDPOINT");
var key = Environment.GetEnvironmentVariable("LANGUAGE_KEY");
var projectName = "CoffeeShopBot";
var deploymentName = "production";

var client = new ConversationAnalysisClient(
    new Uri(endpoint),
    new AzureKeyCredential(key));

var utterance = "I'd like a large cappuccino with oat milk, please";

var response = client.AnalyzeConversation(
    utterance,
    projectName,
    deploymentName);

var result = response.Value;
Console.WriteLine($"Intent: {result.TopIntent}");
Console.WriteLine($"Confidence: {result.TopIntentScore:P2}");

foreach (var entity in result.Entities)
{
    Console.WriteLine($"Entity: {entity.Text} -> {entity.Category} "
        + $"({entity.ConfidenceScore:P2})");
}

Backup and Recovery of CLU Models

CLU projects can be exported and imported across Language resources. The export creates a JSON file containing the complete project definition including intents, entities, utterances, and labels. This file does not contain the trained model weights; you must retrain after importing. Export your project regularly as a backup, especially before making significant schema changes.

To export a project in Language Studio, go to the project settings and click "Export." The JSON file downloads to your local machine. To import, create a new project and select "Import" instead of "Create new." Browse to your export file, and Language Studio recreates the project with all intents, entities, and utterances. Then trigger a training job to rebuild the model.

Using ChatGPT to Generate Sample Utterances

One challenge in building CLU models is generating enough diverse utterances for each intent. Large language models like ChatGPT and GPT-4 can help generate training utterances. The key technique is to provide a clear prompt that describes your intents and entities and asks for natural variations. Always review AI-generated utterances for quality and consistency before adding them to your training set, as the generated phrases may contain unnatural language or miss domain-specific terminology.

Prompt for generating utterances:
"Generate 20 diverse utterances for a coffee shop ordering system.
The intent is 'OrderCoffee'. The entities are DrinkType (espresso, latte,
cappuccino, mocha), Size (small, medium, large), Quantity (number),
Modifications (milk type, extra shots, syrups), and Temperature (hot, iced, blended).
Include variations with different word orders, politeness levels,
and entity combinations. Some utterances should have all entities,
others only a subset. Format as a numbered list."

Use AI-generated utterances as a starting point, then edit them to match your actual user base's speaking patterns. If your coffee shop is on a university campus, students might say "Can I grab a..." while corporate customers might say "I would like to order..." Include both styles. Also add utterances with typos, contractions, and filler words to make the training set more realistic.

The Azure OpenAI Service used for generating utterances should not be confused with the CLU service itself. ChatGPT generates training data; it does not replace CLU for intent prediction. Also ensure that AI-generated utterances comply with your organization's data privacy policies, especially if you use the public ChatGPT service rather than Azure OpenAI with data privacy protections.

Exercise: Build a CLU App for a Coffee Shop Ordering System

Create a complete CLU project in Language Studio for a coffee shop ordering system. Follow these steps:

  1. Create a new CLU project named "CoffeeShopBot" with English as the primary language.
  2. Define the following intents: OrderCoffee, CheckMenu (ask about available items), GetStoreHours, CancelOrder, and None.
  3. Define entities: DrinkType (list: espresso, latte, cappuccino, mocha, americano, macchiato), Size (list: small, medium, large), Quantity (prebuilt number), Modifications (learned), Temperature (list: hot, iced, blended).
  4. Add at least 15 utterances for OrderCoffee, 10 for CheckMenu, 10 for GetStoreHours, 5 for CancelOrder, and 10 for None. Label entities in every utterance.
  5. Train the model and review the evaluation metrics. Note the F1 scores for intents and entities.
  6. Deploy the model to the staging slot.
  7. Write a Python script that reads user input from the command line, calls the CLU endpoint, and prints the predicted intent and entities. Run it interactively and test at least 10 different utterances.
  8. Identify at least two utterances that the model misclassifies or handles with low confidence. Add them to your training set with the correct labels, retrain, and compare the new F1 scores.

Submit the final evaluation metrics and a list of the ten test utterances you used with their predicted intents and confidence scores.

Active Learning and Continuous Improvement

CLU supports active learning, which uses real user utterances to improve your model over time. When you enable active learning, the service logs utterances that your application processes and flags those where the model had low confidence. You can review these flagged utterances in Language Studio, correct the intent or entity labels if needed, and add them to your training set. Regular retraining with active learning data keeps your model accurate as user language evolves.

To enable active learning, go to your project settings in Language Studio and toggle "Enable active learning." You can then review endpoint utterances from the "Improve model" section. The review interface shows the utterance, the predicted intent with confidence, and the option to reassign the utterance to a different intent or correct entity labels. After reviewing a batch of utterances, add them to your training set and retrain.

Summary

Conversational Language Understanding (CLU) extracts intents and entities from natural language utterances. It is the successor to LUIS and offers transformer-based models, multi-language support, and integration with Azure AI Language Studio. A CLU project lifecycle includes defining intents and entities in the schema, providing labeled example utterances, training, evaluating F1 scores, deploying to staging and production slots, and consuming via the Conversation Analysis API. Active learning continuously improves the model by incorporating real user utterances. Quality training data with diverse phrasing, a well-trained None intent, and regular retraining are the keys to a successful CLU application. The next chapter covers Custom Question Answering for building knowledge bases from FAQ documents and web pages.