向 SRGS 语法添加通用占位符 [英] Add generic placeholders to SRGS Grammar

查看:26
本文介绍了向 SRGS 语法添加通用占位符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试将语音识别添加到我的应用中.但不幸的是,我没有找到添加通用占位符的方法.例如我想说我正在寻找 stackoverflow"然后我使用这个语法:

I trying to add speech recognition into my app. But unfortunately I don't find a way to add generic placeholders. For example I want to say "I am looking for stackoverflow" then I use this grammar:

<grammar root="start" {...}>
  <rule id="start" scope="public">
    I am       
    <one-of>         
      <item> looking for</item>
      <item> listening to</item> 
    </one-of>
  </rule>

<!-- here could be any word -->

</grammar>

我的问题是,如何实现对stackoverflow"的搜索.如果我使用这种语法,识别器总是会找到我正在寻找".很好,但缺少重要的词.如果我没有使用任何语法,那么我会得到类似我看起来四块牛排溢出"的信息.在这里我得到了重要的词,但不能用规则来约束我是"和寻找".

My problem is, how to implement the search for "stackoverflow". If I use this grammar the recognizer always finds "I am looking for". Great, but the important word is missing. If I am not using any grammar then I get something like "I and looking four steak overflow". Here I got the important word, but cannot use rules to constrain to "I am" and "looking for".

我的需求当然是我正在寻找牛排溢出".

My need is of course "I am looking for steak overflow".

我怎么能做到这一点?提前致谢!

How could I achieve this? Thanks in advance!

推荐答案

没有办法识别任何词",因为你不能严格定义任何词".fasdfewqrqew"是否算作您想要识别的单词?我确定不是.

There is no way to recognize "any word" just because you can not define "any word" strictly. Does "fasdfewqrqew" count as a word you want to recognize? I'm sure not.

我确定您想识别特定的单词列表,可能很大.然后你可以在 SRGS 语法中列出所有这些.你可以在这里找到一个包含常用词的词表将列表转换为语法.

I'm sure you want to recognize a certain list of words, probably large. Then you can just list all of them in SRGS grammar. You can find a word list with frequent words here and just convert the list to the grammar.

如果你想增加列表覆盖率,你也可以在语法中放置音节序列而不是单词列表.您可以从CMUSphinx项目的CMUDict等语音词典中提取音节列表.这将为您提供更多变体和更少变体,但准备在结果中出现无意义的词.

If you want to increase the list coverage you can also put the sequence of syllables instead of the list of words in the grammar. You can extract the list of syllables from the phonetic dictionary like CMUDict from CMUSphinx project. That will give you more variations with less variants but prepare to get nonsense words in the results.

这篇关于向 SRGS 语法添加通用占位符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆