Importing files

This section describes how to import files into a Mix project. Once you have constructed your files, there are three ways to import them into Mix.

  • Mix dashboard GUI
  • Mix.api via script or command line
  • Mix.cli command line utility

The instructions in this section assume that a Mix project has already been created. For more details, see Create a Mix project.

Import files via the dashboard

Project files can be imported under the Mix dashboard.

To import the TRSX into a Mix project in the dashboard:

  1. Log in to the Mix dashboard and go to the Projects panel.

  2. Select the project from the projects list.

  3. Click on the Import/Export tab.

  4. On the row NLU Model (all data), click on the Import column and select a TRSX file or drag your TRSX file onto the column. If the project is multi-language, you will be prompted to identify the language to which the TRSX file applies. Import TRSX

  5. As needed, select the language for the TRSX.

  6. Repeat steps 4 and 5 as needed for other languages in the project.

  7. On the row ASR Pronunciations, click on the Import column and select a _client.prons.txt file or drag the file onto the column. If the project is multi-language, you will be prompted to identify the language to which the prons file applies. Import prons

  8. As needed, select the language for the prons file.

  9. Repeat steps 7 and 8 as needed for other languages in the project.

  10. On the row ASR Transformations, click on the Import column and select your _tmfe.tsv rewrite file or drag your rewrite file onto the column. If the project is multi-language, you will be prompted to identify the language to which the rewrite file applies. Import rewrites

  11. As needed, select the language for the rewrite file.

  12. Repeat steps 10 and 11 as needed for other languages in the project.

Create project files zip for API-based import

For API-based imports using Mix.api or Mix.cli, project files are uploaded to an existing project as a zip folder.

This folder should have the following contents:

  • metadata.json
  • locale1
    • locale1.trsx
    • _client_prons.txt
    • _tmfe.tsv
  • locale2
    • locale2.trsx
    • _client_prons.txt
    • _tmfe.tsv
  • and so on

The folder contains a JSON file with metadata, and a sub-folder for each language and locale used in the project, with the name of the folder taken from the ab-CD format language code. For example, en-US, fr-CA, and so on.

For more details on project structure, see Project package file structure.

Import files via Mix.api

To import files into Mix via the Mix.api:

  1. Create a project files zip folder containing your project files.

  2. Authorize with Mix using your client ID and client secret to obtain a token to access Mix.api.

  3. Import the project zip using the Replace project contents endpoint. Use the previously obtained token in the header.

curl -X 'POST' \
  'https://mix.api.nuance.com/v4/projects/$PROJECTID/.replace' \
  -H 'accept: application/json' \
  -H 'Content-Type: multipart/form-data' \
  -H 'authorization: Bearer $TOKEN' \
  -F 'content=project_contents.zip;type=application/x-zip-compressed'

Import files via Mix.cli

Carry out the following steps to import project files using Mix.cli.

  1. Create a project files zip folder.

  2. If not done previously, use the mix init  command and enter the required information to configure Mix.cli to work with your application. This includes service credentials.

  3. Use the mix auth  command to obtain an authorization token to access Mix.api.

  4. Use the mix projects:replace  command to replace project contents with your project files zip folder.

Next steps

With your project files imported, you can proceed to build your DLM.