How Tos

Last reviewed: 7/15/2011

Article ID: H071131

HOW: Implementing 1-Shot (2-pass) recognition

The information in this article applies to:

  • SpeechKit 7

Summary

1-Shot (2-pass) recognition refers to the capturing multiple slot items from a single utterance, as opposed to capturing (and confirming) each slot individually provided by the Voice Destination Entry (VDE) capability of VoCon 3200.

More Information

To optimize recognition for large grammars, for example street address, VoCon provides a special-purpose grammar format and recognition processing referred to as 1-Shot.

SpeechKit 7 supports 1-Shot (2-pass) recognition required to process these grammars. New speech resources: CSRActivateField, CSRStopField, CSRStopField are available to pass the values needed to recognize the desired fields of these grammars.

The following example illustrates defining, enabling, and disabling grammar resources for 1-Shot (2-pass) speech recognition.

private Chant.SpeechKit.NChantSR NChantSR1;
// Instantiate NChantSR object
NChantSR1 = new NChantSR(this);
NChantSR1.SetNumberProperty(ChantNumberProperty.CNPEngineAPI, (int)ChantEngineAPI.CEVoCon4);
// Win32 - Set the path to the VoCon runtime libraries
NChantSR1.SetStringProperty(ChantStringProperty.CSPEnginePath, "C:\\Program Files\\Nuance\\vocon3200\\EDS_v4_1\\bin\\winx86rls");
// Win32 - Set the file name of CLC model
NChantSR1.SetStringProperty(ChantStringProperty.CSPCLCModel, "C:\\Program Files\\Nuance\\vocon3200\\EDS_v4_1\\models\\clc_enu_cfg3_v1_0_0.dat");
// Win32 - Or set the file name of DDG2P model
//NChantSR1.SetStringProperty(ChantStringProperty.CSPDDG2PModel, "C:\\Program Files\\Nuance\\vocon3200\\EDS_v4_1\\models\\ddg2p_enu_vadvde_ttsasr_large_v2_1_3.dat");

// Define field definition grammar
int grammarVocabID = NChantSR1.DefineResource(ChantSpeechResource.CSRNativeGrammarVocab, "vde_pass1.lcf");

// Define fields
NChantSR1.AddResource(ChantSpeechResource.CSRStartField, grammarVocabID, "street");
NChantSR1.AddResource(ChantSpeechResource.CSRStopField, grammarVocabID, "state2");
NChantSR1.AddResource(ChantSpeechResource.CSRActivateField, grammarVocabID, "state");

// Define field data grammar
int grammarVocabID2 = NChantSR1.DefineResource(ChantSpeechResource.CSRNativeGrammarVocab, "vde_pass2.fcf"); 

// Only load and enable the field definition grammar vocabulary
NChantSR1.EnableResource(ChantSpeechResource.CSRNativeGrammarVocab, grammarVocabID);

// Disable it
NChantSR1.DisableResource(ChantSpeechResource.CSRNativeGrammarVocab, grammarVocabID);