Testing robust parsing grammars

Robust parsing grammars can be tested as other grammars are, by using the parseTool utility. Submit the grammar to parseTool, and set the test_sentences switch. Then, enter test sentences.

The example below assumes you submitted the example grammar shown in Add the FSM and wordlist to the grammar. Here is a test sentence:

"i would like to go out for a fast food restaurant spending around five euros per person in madrid"

The output appears as follows (assuming that no extra n-best keys are set):

<?xml version='1.0'?>
    <result>
        <interpretation grammar=
            "ParseToolGrammar" confidence="100">
        <input mode="speech">
            i would like to go out for a fast food restaurant
            spending around five euros per
        </input>
        <instance>
            <type confidence="100">
                fast food
            </type>
            <price confidence="100">
                5
            </price>
            <SWI_literal>
                I would like to go out for a fast food 
                restaurant spending around five euros per
            </SWI_literal>
            <SWI_grammarName>
                ParseToolGrammar
            </SWI_grammarName>
            <SWI_meaning>
                {price:5 type:fast food}
            </SWI_meaning>
        </instance>
    </interpretation>
</result>

Here is a another test sentence:

"i want to go to the south gate to an italian restaurant"

The result looks like this:

<?xml version='1.0'?>
    <result>
        <interpretation grammar=
            "ParseToolGrammar" confidence="100">
            <input mode="speech">
               i want to go to south gate to an italian restaurant
            </input>
            <instance>
            <location confidence="100">
            south gate
            </location>
            <type confidence="100">
                italian
            </type>
            <SWI_literal>
               I want to go to south gate to an italian restaurant
            </SWI_literal>
            <SWI_grammarName>
                ParseToolGrammar
            </SWI_grammarName>
            <SWI_meaning>
                {location:south gate type:italian}
            </SWI_meaning>
            </instance>
        </interpretation>
    </result>

In these examples the confidences for all slots are equal to one hundred. This is because text input was used. If you ran the application and recognized speech, the confidence values would be varied.

Use these confidence values to direct the dialog flow. For example, if the “location” slot has a high confidence, but the “price” slot has a low confidence, the application can ask for the price in the next question. When doing this, the application phrases the next prompt in a way that makes it clear the price was heard earlier, but not understood—otherwise, it appears to the caller as if the previous utterance was partially ignored, and this uncertainty can lead to subsequent errors.

Slots with medium confidence values can be verified explicitly by asking a supplementary question, such as "I think you are looking for an Italian restaurant. Is that correct?"