Building and deploying multiple DLMs

This section describes how to build multiple DLMs for a single application in Mix.

Sometimes a speech application will require multiple DLMs. For example, a single application might have to deal with requests related to multiple different domains or subdomains. These different DLMs can be used together at runtime as part of the same recognition turn. The DLMs can be independently weighted, and the weightings of different DLMs can be readjusted at different contexts within the application. Using multiple specialized DLMs can improve accuracy as compared to one all-purpose DLM.

Example scenario for multiple DLMs

Here is an example of an application that might benefit from multiple DLMs. Suppose you have a financial application.

This application might use three different DLMs built from three different projects:

  • DLM A boosts finance-domain related recognition in general, and is be used throughout the application. It is trained on a broad set of samples covering the domain. The project is also used to build an NLU model.
  • DLM B is built from samples related to credit card transactions and specifically boosts recognition related to this sub-domain. This DLM can be tuned to a lower weight most of the time, but can be given a higher weight when in a credit card processing flow of the application.
  • DLM C contains custom pron entries that could have been combined into DLM B, but it is maintained by another team that has its own project that was built into DLM C.

Using multiple DLMs runtime

Mix projects and DLMs

A single Mix project can only generate one DLM. Therefore, if you need multiple DLMs for your application, you will need to create a new project for each DLM, build each project into a DLM, and for each DLM, deploy an app configuration containing the DLM under a common Mix application.

If your application also requires an NLU model and/or a dialog model, you will need to select one of these projects to build the other models. Applications can use at most one NLU model or dialog model.

Process for building multiple DLMs

For each DLM you need, do the following:

  1. Go to the Projects tab in Mix and create a Mix project.

  2. Create and assemble the necessary file inputs. For each project, this will consist of one or more TRSX files with training set samples and ontology definitions, as well as possibly pron and rewrite files. Recall that for a multilingual project, you will need separate TRSX, pron, and rewrite files for each language in that project. If your project will be used to create an NLU model, your training set and TRSX need to be aligned toward the requirements of an NLU model.

  3. Import the file inputs into each project using either the Mix dashboard Projects tab (under Import/Export) or via scripting using Mix.api or Mix.cli.

  4. Build your model resources from the project. Follow the appropriate procedure depending on whether you need to build a DLM only from the project, or both a DLM and an NLU model.

  5. Add a new app configuration containing the DLM (and NLU model, as applicable) under the existing application.