Export (0) Print
Expand All

Phrase Generator Command-Line Syntax

The command-line syntax for Phrase Generator has the following format.

PhraseGenerator /In <input file name> /Out <output file name> /RecoConfig <configuration file name> /Rule <ID of the rule for which phrases will be generated> /MaxPhrases <number of phrases to generate> /Method <sampling method> /Seed <integer> /DoNotExpand <list of internal rules not to expand> /DoNotExpandExternal

The following table describes the command-line option names and values for Phrase Generator.

Option Name

Description

/In

Required. A string that contains the file name and extension of an XML-based grammar file, for example "MyGrammar.grxml".

The grammar specified by the /In option must be available on the same computer as PhraseGenerator.exe or on a connected local network.

Phrase Generator follows references to rules in external documents and generates phrases for externally referenced rules. External documents containing rules referenced from the input document must be on the same computer as PhraseGenerator.exe or on a local area network to which the computer is connected. References to rules in documents on web servers are not supported.

/Out

Required. A string that contains the file name and extension of the output utterance file, for example MyGrammarOutput.utt.

/RecoConfig

Optional. The name of the configuration file to use for the speech recognition engine. If not specified, the tool will look for a default configuration file named “RecoConfig.xml” in the current working directory and in the directory that contains PhraseGenerator.exe. The tool will generate an error if you do not supply it with a configuration file.

/Rule

Optional. A string that contains the id of the rule to process, for example "MyRule". Phrases are generated for the specified rule and all rules referenced by this rule. If this option is not specified, the phrase generator generates phrases from the root rule of the document specified by the /In option, and all the rules referenced by the root rule.

The id value specified in the /Rule option must be contained in the grammar document that is specified in the /In option.

/MaxPhrases

Optional. Must be specified if the value of the /Method option is SampleByWeight. A string that specifies the maximum number phrases to generate, for example "1000". There is no upper limit to the number of phrases that you can specify in this option. If /MaxPhrases is not specified, Phrase Generator writes the phrases for the root rule and all rules it references, or for the rule specified in the /Rule option and all the rules it references. If the value for /Method is Exhaustive and /MaxPhrases is not specified, Phrase Generator will write up to 100,000 phrases, which is the default value for /MaxPhrases.

/Method

Optional. Indicates the method to be used for extracting phrases. The value can be one of Exhaustive or SampleByWeight. The default value is Exhaustive.

/Seed

Optional. An integer value that is used to generate sample phrases. Only relevant if the /Method value is SampleByWeight which uses the value to generate the results. Reusing the same value will produce the same set of results, unless the input file has changed. If a /Seed value is NOT specified, then the tool will generate its own value and write it both to the console and to the output file when applicable to generation.

/DoNotExpand

Optional. A list of rule names in the input grammar file that should not be expanded in the generated output. In the output, skipped rules appear in square brackets. By default, Phrase Generator attempts to expand all rules, both internal and external to the grammar.

/DoNotExpandExternal

Optional. A Boolean option that does not take a value. If specified, any rule that is external to the input file grammar will not be expanded. In the output, skipped external rules appear in square brackets. By default, this is not enabled.

/?

Optional. Displays a list of acceptable option/value pairs.

NoteNote
  • Command-line options are not case-sensitive.

  • Command-line options can be preceded by a forward slash (0x002F), a dash (0x002d), an en dash (0x2013), an em dash (0x2014), or a horizontal bar (0x2015).

  • You can enter option/value pairs in any sequence.

Caution noteCaution

If an existing file has the same name as the file name specified by the /Out option, it will be overwritten. The tool does not warn that a file will be overwritten.

You must either specify a recognition engine configuration file using the /RecoConfig option, or create a default configuration file named "RecoConfig.xml" either in the current directory (the directory for the command line) or in the directory that contains PhraseGenerator.exe. Use the configuration file to specify a speech recognition engine to use, to configure the parameters for connecting to it, and to configure its behavior. For more information, see Setting Up the Grammar Development Tools.

If an item element in a grammar file specifies a repeat count of "1-", meaning it can be repeated any number of times, then the tool will continue to generate phrases up to the value specified in /MaxPhrases. If /MaxPhrases is not specified, the tool will generate 100,000 phrases, which is the default setting for /MaxPhrases. In the following example, phrases for the rule "#digit" will be generated until the limit specified in /MaxPhrases or its default limit is reached:

<item repeat="1-">
<ruleref uri="#digit"/>
</item>

NoteNote

Depending on system and memory constraints, the tool may be unable to process grammars that contain in excess of 100,000 phrases.

The following are several usage examples of the Phrase Generator.

Generate all phrases for the grammar's root rule and all rules it references, and output the phrases to the file "MyUtterances.utt":

PhraseGenerator /In MyGrammar.grxml /Out MyUtterances.utt

Generate all phrases for the grammar's root rule and all internal rules it references, and output the phrases to the file "MyUtterances.utt". All external rules will be skipped and will appear in brackets in the output file:

PhraseGenerator /In MyGrammar.grxml /Out MyUtterances.utt /DoNotExpandExternal

Generate 100 random phrases using rule weights for <Rule id="MyRule"> and all rules it references and let the tool generate the value for /Seed:

PhraseGenerator -In MyGrammar.grxml -Out MyUtterances.utt -Rule MyRule -MaxPhrases 100 –Method SampleByWeight

Show:
© 2014 Microsoft