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.
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.
Note:
The project used to build an NLU model should generally be intended to broadly cover the domain of the application. The training set for this project should cover a broad range of utterances in the domain. As such, the DLM that you build from this project should be used for all recognition turns.Process for building multiple DLMs
For each DLM you need, do the following:
-
Go to the Projects tab in Mix and create a Mix project.
-
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.
-
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.
-
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.
-
Add a new app configuration containing the DLM (and NLU model, as applicable) under the existing application.