Combine free-form dictation and semantic in a srgs

2019-02-20 20:23发布

I'm trying to combine both the result of a semantic and a dictation request in the semantic value of a SRGS document. For example, I would say "Search potato" and the output would be something like out="Search Potato" where Potato is a random word spoken by the user. I tought about using the garbage special rule, but it doesn't seem to work. So far that's what I have :

<rule id="rule1" scope="public">
<one-of>
  <item xml:lang="en-us">Search</item>
  <item>Cherche</item>
</one-of>
<tag>out.command="Search"</tag>
<tag>out.param1=<ruleref special="GARBAGE"/></tag>
<tag>out=out.command+out.param1;</tag>

I also saw that post : Free-form text with custom SRGS based Grammer where someone proposed the DICTATION tag. But the problem is that it doesn't seem to be SRGS compatible.

If it helps, i use tag-format="semantics/1.0"

2条回答
Root(大扎)
2楼-- · 2019-02-20 20:49

If you look at the W3C paper "Extending SRGS to Support More Powerful and Expressive Grammars" you can see that this standards group sees the need for just the scenario you are mentioning (see example 1.a) but it currently is not supported in the SRGS standard. Your question is how to do this with SRGS but there are probably ways to achieve the same results outside of SRGS dependent upon the ASR platform being used.

查看更多
Emotional °昔
3楼-- · 2019-02-20 20:53

I have also searched high and low for this, and have finally found the answer. I have used the following code and loaded it into System.Speech.Recognition.Grammar and it works perfectly.

<ruleref uri="grammar:dictation" type="application/srgs+xml"/>

Just add this ruleref as an item wherever you want to get the dictated text. You can pull out the dictated text into a semantic/tag by using this directly after the ruleref:

<tag>out.SpokenText=rules.latest();</tag>
查看更多
登录 后发表回答