Skip to main content
Skip table of contents

Voice Commands Widget

Grammar-based recognition is a technology that enables reliable voice commands. Prepare and configure your voice commands in this widget before integrating them into your product.

Widget Navigation

Let’s begin by exploring the main options available in this widget.

VOICE COMMANDS.png

Navigate between your models

  • Navigate back (1) to the Project Hub

  • Change the Selected Model (2) you are editing

  • The widget global editing tools (3):

    • Add this model to Favorites

    • Create a new model

    • Rename the model

    • Configure the recognizer

    • Delete the model

  • Change the Model’s Language (4)

  • Quick Test (5) your model in real time within the widget by speaking

  • Go to the Voice Commands Unit Testing (6) page to verify your model meets production needs with a dedicated process. See this documentation about Unit Testing to learn more.

Grammar Editor

Our Grammar Editor allows you tp edit voice command files formatted in BNF.

Why use BNF format ?

Why use BNF format?

Voice command systems rely on grammars to interpret spoken input accurately. BNF lets you define the precise structure of valid commands, ensuring the system only recognizes intended phrases and rejects ambiguous or invalid inputs.

Here is a brief example of a voice commands grammar file. For more details, please refer to our dedicated documentation.

CODE
#BNF+EM V2.1;

!grammar VoicePickGrammar;

// Start rule for the grammar
!start <main>;

// Main rule that encompasses various ways someone might initiate a voice pick
<main>: <direct_pick> [<item>] [<quantity>];

// Direct commands for picking an item
<direct_pick>: "pick" | "select";

// Optional slot for specifying the item to pick
<item>: "item" | "product" | "object" | "thing";

// Optional slot for specifying the quantity of items to pick
<quantity>: "one" | "two" | "three" | "four" | "five";

...

Grammar Edition Tools

VOICE COMMANDS 2.png

Grammar edition made easier than ever

We invite you to try our recent Grammar Generator (1), which creates a starting point for you based on your prompt.

How to use the Grammar AI Generator ?

How to use the Grammar AI Generator ?

VOICE COMMANDS 3.png

You can write much detailed prompts

Elaborate your prompt and paste it (1) to describe the expected behavior of your voice commands. The AI respects BNF standards and provides comments on its design choices.

Click Generate (2) to obtain a ready-to-use grammar in under 5 seconds. There are no limits, aside from decency, on using our AI tools within your project licensing.

Use Create a New Model (3) to save your current grammar. Your project can store an unlimited number of models.

Use Replace current grammar (4) to apply your newly generated grammar directly. Please note that lost grammar cannot be restored.

Your Grammar Editor (2) is based on Monaco Editor, which is built on VS Code. Right-Click to access standard VS Code functions, and all familiar shortcuts work. Use ALT+Click for multiple cursors. Save your work with CTRL+S or with the dedicated Save Model (7) button. Note: you cannot Quick Test your model until it is saved.

Our comprehensive error parser and lexer (3) assist you while editing. Errors include line and column information with detailed messages. Text containing errors is underlined in red, and hovering over it shows a tooltip with full details.

image-20251120-085920.png

A common mistake is creating a loop in grammar rules

To reach production, you’ll likely need to translate your grammar—a challenging step, but we can help. Our Translation AI Tool (4) allows you to quickly translate voice commands while preserving all rules and comments. Your unit testing processes will ensure that your grammar behaves correctly in every language.

How to use the Translation AI Tool ?

How to use the Translation AI Tool ?

VOICE COMMANDS 4.png

Choose the Target Language (1), knowing that the source language is inherited from the Model’s Lang (2). Click Translate (3) to generate ready-to-use grammar in under 5 seconds. There are no limits, aside from decency, on using our AI tools under your project licensing. Finish by selecting Create as New Model (4).

Advanced Grammar Edition

a. Grammar Slots

Voice Commands Grammars offers the possibility to inject dynamic values at runtime using slots. Please refer to our documentation to learn about slots.

For each slot in your grammar you will need to provide a value in the dedicated tab Dynamic Slot Values (5).

How to create a Slot ?

How to create a Slot ?

image-20251121-143401.png

Defining a slot in the grammar editor is simple: !slot <myslot>;

VOICE COMMANDS 5.png

The Dynamic Slot Value Tab

First copy the name of your slot, then click on Define a Dynamic Slot (1). This will open a dedicated modal for creating the slot.

VOICE COMMANDS 6b.png

Define Slot Values

Click + button (2) to add a value to the slot. When editing a slot value in the dedicated field (3), press Enter to automatically create a new value - it is quickier. To remove a value, click the delete button (4). Do not forget to Confirm (5) otherwise your changes will not be saved.

How to edit a Slot ?

How to edit a Slot ?

VOICE COMMANDS 5b.png

Slots edition

Create additional slots by repeating the steps above. For more details, see “How to create a Slot”. Edit slots with the Edit Slot (3) button and delete them with Delete Slot (4). Deleted slots cannot be recovered. Note that deleting a slot does not automatically update your grammar—you must remove it from the grammar separately.

To make a slot functional you need :

  • A slot defined in your grammar

  • The same slot referenced somewhere within the same grammar

  • Predefined values filled in the dedicated table

b. Grammar Phonem Templating

We provide a growing list of phoneme templates to improve recognition of your commands. If your grammar is one of the supported languages, the Templates (6) button will appear:

  • Dutch (Netherlands)

  • English (United Kingdom)

  • French (France)

  • German (Germany)

  • English (India)

  • Italian (Italy)

  • Portuguese (Brazil)

  • Spanish (Spain)

  • Spanish (Mexico)

Clicking the button opens the template in a dedicated modal. Adding the template does not replace your existing grammar. It appends the template at the end.

image-20251121-150235.png

Example of our pronunciation templates

Testing the Voice Commands Model

Voice Commands X.png

The test panel

When the test panel is open and ready, click Start recording (1) to play the model for one minute. Adjust the confidence threshold (2) in real time to filter hypotheses below the minimum score. Speak the voice commands aloud and watch the hypotheses appear (3), based on your model's recognizer parameters.

How to read hypothesis ?

How to read hypothesis ?

image-20251210-144604.png

Zoom on hypothesis

The key information is the Start rule. Most grammars have a single main rule, though multiple starting rules can be useful in certain cases.

  • A confidence score of over 6000 (above the 4000 threshold) allows the hypothesis to be displayed.

  • Alternative hypotheses contain the same information as the main hypothesis.

The hypothesis details show the confidence score for each entity within your voice commands, inside the whole utterance. It allows you to understand which part of the voice command is less understood by the technology.

What are recognizer options ?

What are recognizer options ?

image-20251210-145718.png

Voice Commands Recognizer parameters

Based on this documentation page containing Recognizer parameters, we provide the most used parameters that have a real impact in Quick Testing. Remember you can still change those parameters after Downloading the project.

TSILENCE: The silence period required to detect the Voice Command has elapsed. Any voice recognized afterward will be treated as a new Voice Command.

STREAM_RESULT_MODE: This means results will appear while you speak. Even if you do not pass the TSILENCE, "partial" results will still appear.

MAXNBEST: This value represents the maximum number of hypotheses considered and displayed in the test.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.