VXML:同等の入力で文法を定義します
-
02-10-2019 - |
質問
Tellmeに基づいたエンジンを使用しています。私は、ユーザーが同じと見なされるいくつかの異なることの1つを言うことができる文法の例を見てきました。ただし、私が見たすべての例は、インライン文法(VXMLエンジンIMを使用して動作しない)のためのものでした。 .grxmlファイルを変更してこれを行う方法を知りたいです。これはファイルです:
<?xml version="1.0"?>
<!-- created by Matthew Murdock. Grammars for speech rec menus -->
<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" xml:lang="en" version="1.0" mode="voice" scope="dialog" tag-format="semantics/1.0.2006">
<rule id="keep">
<one-of>
<item>exit</item>
<item>exit the system</item>
<item>another</item>
<item>another mailbox</item>
<item>play</item>
<item>play back</item>
</one-of>
</rule>
</grammar>
6つのアイテムを持つ代わりに、3つのアイテムがあり、それぞれ2つの発話があります。これを行う方法についてのアイデアはありますか?
解決 3
私はそれを考え出した。私は文法をこのように見せるように変更しました:
<?xml version="1.0"?>
<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" xml:lang="en" version="1.0" mode="voice" scope="dialog" tag-format="semantics/1.0-literals">
<rule id="keep">
<one-of>
<item><ruleref id="#exit"/></item>
<item><ruleref id="#play"/></item>
</one-of>
</rule>
<rule id="exit">
<one-of>
<item>exit</item>
<item>exit the system</item>
</one-of>
<tag>out.result = "exit"</tag>
</rule>
<rule id="play">
<one-of>
<item>play</item>
<item>play back</item>
</one-of>
<tag>out.result = "play"</tag>
</rule>
</grammar>
次に、callerinput(で指定された変数に基づいて、私のスクリプトに戻ります。 <field>
タグ)、私はそれらをcallerinpup $に基づいています。 <tag>
文法の要素。
発信者の文字通りの入力ではなく、「解釈」に基づいて行動することは理にかなっていると思います。
注:独自のVXMLエンジンを使用しているため、XMLから解釈値を抽出する方法を作成できました。
他のヒント
よりコンパクトなフォーム:
<rule id="exit">
exit <item repeat="0-1">the system</item>
<tag>out.result = "exit"</tag>
</rule>
<rule id="play">
play <item repeat="0-1">back</item>
<tag>out.result = "play"</tag>
</rule>
あなたが望む答えはにあります sisr 入力パスに意味を付けるメカニズムを提供する仕様。あなたの例を書き直す:
<?xml version="1.0"?>
<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" xml:lang="en" version="1.0" mode="voice" scope="dialog" tag-format="semantics/1.0-literals">
<rule id="keep">
<one-of>
<item>
<one-of>
<item>exit</item>
<item>exit the system</item>
</one-of>
<tag>exit</tag>
</item>
<item>
<one-of>
<item>another</item>
<item>another mailbox</item>
</one-of>
<tag>another</tag>
</item>
<item>
<one-of>
<item>play</item>
<item>play back</item>
</one-of>
<tag>play</tag>
</item>
</one-of>
</rule>
</grammar>
知っておくべきいくつかのこと:
- リテラルタグ形式を選択しました(文法要素のタグ形式属性に注意してください)。また、「Semantics/1.0」を使用して実装されている可能性があり、タグの内容は次のように見えました。
- tellmeタグ形式の値は異なる必要があるかもしれませんが、 開発ガイド 彼らが基準に従うことを意味します。
- 動作したら、フィラーグラマーを作成することをためらわないでください(SRGが話す、ルール)。フィラールールは、SI(タグ要素なし)のないルールであり、人々が応答に追加する一般的なフレーズを含みます。たとえば、文法の終わりに追加できる後続ルール:
</one-of> <item repeat="0-1"><ruleref uri="#trailing"/></item> </rule> <rule id="trailing> <one-of> <item>please</item> <item>thank you</item> </one-of> </rule> </grammar>
これは、より自然なタイプの応答をサポートします。これは、呼び出しベースに応じて重要である場合とそうでない場合があります。フィラーグラマーは非常に大きい場合がありますが、非常に再利用可能になる傾向があります。入力の先頭にフィラーを追加することもできます。豊富なスピーチアプリケーションでは、チューニングプロセスで最も重要な利益は、文法を更新して、発信者が話した実際のフレーズと、開発者やVUIデザイナーが考えていることを含むことです。