Add a grammar for a bot flow in Architect
Feature coming soon
Prerequisites
In Architect, you can use a grammar-based automatic speech recognition (ASR) third-party engine, for example Nuance Recognizer as a Service integration, to customize grammar recognition and capture the result.
GRXML for DTMF
<?xml version="1.0" encoding="UTF-8"?>
<grammar xmlns="http://www.w3.org/2001/06/grammar"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd"
version="1.0"
mode="dtmf"
xml:lang="en-US"
tag-format="semantics/1.0"
root="ROOT">
<rule id="ROOT" scope="public">
<one-of>
<!-- checking-->
<item>
<one-of>
<item>1</item>
</one-of>
<tag> out = "checking" </tag>
</item>
<!-- savings-->
<item>
<one-of>
<item>2</item>
</one-of>
<tag> out = "savings" </tag>
</item>
</one-of>
</rule>
</grammar>
GRXML for Voice
<?xml version="1.0" encoding="UTF-8"?>
<grammar version="1.0"
xmlns="http://www.w3.org/2001/06/grammar"
mode="voice"
xml:lang="en-US"
tag-format="swi-semantics/1.0"
root="ROOT">
<rule id="ROOT" scope="public">
<one-of>
<!-- checking-->
<item>
<one-of>
<item>
<item repeat="0-1">
<one-of>
<item>a</item>
<item>the</item>
<item>my</item>
</one-of>
</item>
<item>
<one-of>
<item>checking</item>
<item>check</item>
</one-of>
</item>
<item repeat="0-1">account</item>
<item repeat="0-1">please</item>
</item>
</one-of>
<tag> SWI_meaning = "checking" </tag>
</item>
<!-- savings-->
<item>
<one-of>
<item>
<item repeat="0-1">
<one-of>
<item>a</item>
<item>the</item>
<item>my</item>
</one-of>
</item>
<item>
<one-of>
<item>savings</item>
<item>saving</item>
</one-of>
</item>
<item repeat="0-1">account</item>
<item repeat="0-1">please</item>
</item>
</one-of>
<tag> SWI_meaning = "savings" </tag>
</item>
</one-of>
</rule>
</grammar>
Add the grammar-based Nuance Recognizer as a Service integration and then choose from the Nuance voice and language options in Architect’s Ask for Intent action for Genesys Dialog Engine Bot Flows.
To add grammar to Architect, follow these steps:
- Click Admin.
- Under Architect, click Architect. Architect opens in a new tab.
- Click Grammars.
- Click Add. The Create New Grammar dialog box opens.
- Under Grammar Name, give your grammar a meaningful name.
- (Optional) Under Grammar Description, add descriptive details about the grammar. For example, “recognize 4 to 8 digits.”Note: You can add descriptive language here or you can add it later in the Grammar Editor.
- (Optional) Click the Starting Language and select the initial language that you want the grammar to use.Note: You can leave the starting language set to None, but you must add at least one language in the Grammar Editor before you can use the editor.
- Click Create. The Grammar Editor opens.
- To add one grammar language at a time, follow these steps:
- Click Add Language.
- From the Select Language dialog box, choose another language for the grammar to use.
- Repeat steps a-b to add another language.
- Depending on the type of grammar that you want to add, click one of the following tabs:
- DTMF
- Voice
- Add the GRXML content from Nuance Recognizer ASR grammar into the editor.Note: If the grammar passes XML validation, then a green message appears, letting you know that the grammar is free of errors. If a red message appears, then Architect lets you know the location in the GRXML that the error or errors exist.
- Click Save. Note: If you attempt to save the grammar without correcting errors, the XML Error dialog box opens and asks you to confirm that you want to proceed.