Building DLM and NLU model

This section describes how to build a DLM and and NLU model from a Mix project.

A single Mix project can build to produce one DLM and one NLU model.

Once the necessary resources are imported into Mix, a DLM and a NLU can be built in Mix using:

  • Mix dashboard
  • Mix.api
  • Mix.cli

Build model resources using the dashboard

To build a model resources from a Mix project, carry out the build procedure described at Build resources. Make sure that the resources you need are selected.

Build DLM only

If you are building a DLM only, deselect NLU and Dialog from the list of resources so that only ASR is selected.

Build DLM and NLU model

To create both a DLM and a NLU model, keep ASR and NLU are selected. If you are intending to use your resources in a Dialog application, and you have used this project to design your Dialog model, leave Dialog selected as well.

Build model resources using Mix.api

To create a DLM and NLU model build using Mix.api, use the Start a build endpoint.

You need to specify the Mix project ID as a path parameter.

You will need to have Authorized with Mix using your client ID and client secret to obtain a token to access Mix.api.The authorization token needs to be included in the header of the Mix.api call.

The request body includes fields as needed for the types of models to build.

DLM-only build Mix.api code example

Here is an example of a call to the endpoint using CURL. This builds a DLM only.

curl -X 'POST' \
  'https://mix.api.nuance.com/v4/projects/$PROJECTID/.build' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'authorization: Bearer $TOKEN' \
  -d '{
  "asr": {
    "notes": "string"
  },
  "locales": [
    "string"
  ]
}'

Build NLU and DLM Mix.api code example

Here is an example of a call to the endpoint using CURL. This builds both a DLM and an NLU model.

curl -X 'POST' \
  'https://mix.api.nuance.com/v4/projects/$PROJECTID/.build' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'authorization: Bearer $TOKEN' \
  -d '{
  "asr": {
    "notes": "string"
  },
  "nlu": {
    "notes": "string",
    "settings": {
      "modelType": "FAST"
    }
  },
  "locales": [
    "string"
  ]
}'

Build model resources using Mix.cli

The mix projects:build command  can also be used to build model resources from a Mix project using Mix.cli.

You will need to have configured Mix.cli and obtained an access token previously.

Specify the locale and project ID and use --build-type asr and --build-type nlu as arguments as needed.

DLM-only build Mix.cli code example

Here is an example of a call using Mix.cli. This builds a DLM only.

mix projects:build -L en-US -P $PROJECT_ID --build-type asr

DLM and NLU model build Mix.cli code example

Here is an example of a call using Mix.cli. This builds both a DLM and an NLU model.

mix projects:build -L en-US -P $PROJECT_ID --build-type asr --build-type nlu