Skip to content

Microsoft CLU

DialoX can use the Microsoft Conversational Language Understanding (CLU) service to help with intent classification. CLU is the successor of Microsoft's Luis service.

To use it, a few steps need to be taken.

Create integration token

Add the following entry to the integrations yaml file in the bot, or create the integrations YAML file in the root level if it does not exist yet:

- provider: msclu
  context: bot
  alias: msclu
  description: "Intent resolution using Microsoft CLU"

And publish the bot when done. In the main menu, a new 'Integrations' menu item will appear.

Connect integration to CLU API

In the Azure portal, create a new resource of type 'text analysis'. After it has been deployed, go to the 'Keys and Endpoint page there to copy the Key 1, region and endpoint.

In the botsquad platform, paste these data into the integration settings:

After clicking 'save' it validates and stores the credentials in the bot.

Create CLU project

Visit Language Studio to create a new project there of type "Conversational language understanding".

Be sure to configure the project to enable multiple languages:

Take a note of the project name, you will need this in the next step.

Create Intents file with CLU as intent provider

Create a new, empty NLP intents file with the following contents:

intents: []
provider_type: msclu
provider_agent: PROJECTNAME

Where you replace PROJECTNAME with the project name you set in the previous step.

Push defined intents from DialoX to CLU

Now go to the "Training" page in botsquad and start creating intents and utterances as usual. As soon as you have created a few, the "train" button will appear. Click it to push all the intents to the CLU project.

Note that clicking "train" in the UI here does not actually train, because this takes too long on the CLU side! You need to manually train the project in CLU yourself.

Create CLU deployment

Train the model in CLU and evaluate it in the Language Studio UI. As soon as you are happy with the results, create a deployment for the trained model, giving it a name, preferably naming it default.

Specify CLU as intent resolver in NLP pipeline

To use the trained model and CLU deployment, now create a nlp YAML file in the bot and remove all intent resolver steps (QnA, Dialogflow), replacing the file with the following contents:

# This is the default NLP pipeline
pipeline_steps:
  - step: pattern_ignore
    options:
      pattern: "^[.]"
  - step: markup_stripper
  - step: auto_translator
  - step: spacy_tokenizer
  - step: duckling_entity_extractor
  - step: bml_intent_matcher
  - step: clu_intent_classifier
    options:
      provider_agent: PROJECTNAME
      deployment: default

Again, replacing PROJECTNAME with your CLU project's name. Publish the bot and you're done. Now in the 'intent tester' pane in the studio, verify that intents are resolved using CLU for any message: