Custom Form Confusables

Consider the following case, where the sound of the employee's first name matches multiple spellings. Is their first name spelled John or Jon?

Employee ID (DTMF)

First Name (Grammar)

12345

John

12346

Jon

The confusables array lists all grammars matched to the returned sound.

Limitations

Select Lumenvox as the ASR.

This feature is not supported when Google is the selected ASR.

Access the Results

The results are stored in a JSON object.

Any node in the call flow following the form node can access the results by assigning a variable to an expression that evaluates the JSON object.

Example:

Follow the form node with a variable node.

In the variable node, assign a variable to an expression that evaluates the JSON object.

Example JSON Object Structure

The structure of the JSON object depends on the custom form type.

Example:
{
"raw_transcribe" : "",
"confidence_score": "",
"additional_information": {
"confusables": [
{
"employee_id": "12345",
"first_name": "John",
},
{
"employee_id": "12346",
"first_name": "Jon",
},
]
}
}

Expression to Evaluate the JSON Object

Follow these steps in the Expression Builder.

  1. In the Function field, select Get Element from JSON from the list of JSON objects.

  2. In the JSON field, select the name of the form node.

  3. In the Path field, click the pencil.

    This opens a new dialog.

    The dialog shows the structure of the JSON object to the left, and blank fields to the right.

  4. From the JSON object, click confusables.

    The fields display as follows.

    The return value is an array like this:

    [
    {
    "employee_id": "12345",
    "first_name": "John",
    },
    {
    "employee_id": "12346",
    "first_name": "Jon",
    },
    ]

    Each of the grammar items in the array matches the sound of the return value. The number of elements in the array is dependent on the number of matches.

Length of the Confusables Array

If the array length is greater than one then more than one grammar matches the returned sound.

Follow these steps in the Expression Builder.

  1. In the Function field, select Get Array Length from the list of JSON objects.

  2. In the JSON field, select the name of the form node.

  3. In the Path field, click the pencil.

    This opens a new dialog.

    The dialog shows the structure of the JSON object to the left, and blank fields to the right.

  4. From the JSON object, click confusables.

    The fields display as follows.

    The return value is the length of the array.