gpt4 book ai didi

speech-recognition - 为什么我的 Microsoft 语音识别结果的置信度总是等于 -1?

转载 作者:行者123 更新时间:2023-12-04 00:12:40 25 4
gpt4 key购买 nike

我正在使用 Microsoft Speech SDK 来实现一个使用语音识别的软件。

我为识别引擎提供了一个非常正常的语法,但是当启动引擎并说出正确的内容时,它识别出我说的是什么,但返回的结果对象的置信度值为 -1。

此外,结果中包含的所有 SemanticValue 对象的置信度也为 -1。

我在相关的 MSDN 页面中找不到这样的结果的含义,实际上只是写了典型的置信度值应该在 0 和 1 之间。

-1 值是什么意思?跟语法有关系吗?

编辑:附加信息:

  • 我正在使用 System.Speech 类与语音识别引擎交互。
  • 识别引擎是 Microsoft English Recognizer v5.1。
  • 我在 XP 上运行该程序,因此语音 SDK 也是 5.1。
  • 输入是麦克风输入:我没有发现用文件提供给这个识别引擎的可能性的踪迹,尽管它会对我有很大帮助。

最佳答案

在 SAPI 中,SREngineConfidence 试图将短语置信度从供应商特定的语音引擎传递到引擎独立的 SAPI 客户端。 SREngineConfidence 在“Microsoft Speech SDK 版本 5.1 SR 引擎供应商移植指南”中描述了一些有趣的行为

http://msdn.microsoft.com/en-us/library/ee431799(v=VS.85).aspx#_Toc503606917说:

It is possible for confidence score information to be included in recognition results. On each phrase element there are two confidence fields that the engine can set. These have both a Confidence (three-level) field and an SREngineConfidence (floating-point) field. If the engine does not explicitly set any of these values, SAPI will try and produce reasonable default values for them. It will produce the Confidence values by averaging the levels for each of the words in the phrase or property, and it will set the SREngineConfidence values to -1.0.

然后说:

If this field is not being used, the engine sets this confidence to -1.0.

可能会给您一些见解的另一个资源是 http://gotspeech.net/forums/thread/3613.aspx .一个帖子说:

In principle, the SREngineConfidence score is a value between 0.0 and 1.0 {higher value meaning higher confidence}. But older versions of the SR engines like 5.1 don't honor this contract precisely, and I don't think the value can really be used with those engines. Only the Hi, Medium, and Low scores in the other Confidence field are usable.

If I remember rightly, you need a more recent version of the SR engine, like the versions that ship with Microsoft Office 2003 or Vista to get a meaningful number in the SREngineConfidence field.

编辑:

我相信 System.Speech.Recognition 确实是 SAPI 的 .net 包装器(参见 http://msdn.microsoft.com/en-us/magazine/cc163663.aspx)。我怀疑上面引用的描述置信度为 -1 的评论可能仍然适用于您使用 System.Speech。我猜您看到的 -1 与提到的问题相同。

我的理解是 XP 没有包含识别器。 Microsoft Office 版本随附。所以,我不确定你真正运行的是哪个识别器引擎。你有安装Office 2003吗?或者您是否安装了像 Dragon 这样的第三方引擎?

您说您安装了识别器 5.1。上面的 GotSpeech.NET 链接说:

But older versions of the SR engines like 5.1 don't honor this contract precisely, and I don't think the value can really be used with those engines.

我建议尝试以下方法:

再补充一点。这是一个从 wav 文件中识别的简短示例:

    SpeechRecognitionEngine myRecognizer = new SpeechRecognitionEngine();
Grammar myGrammar = CreatePizzaGrammar(); // uses GrammarBuilder to create a pizza ordering grammar
myRecognizer.LoadGrammar(myGrammar);
myRecognizer.SetInputToWaveFile("LargeCheese.wav"); // recording of ordering a pizza
RecognitionResult result = myRecognizer.Recognize();
string s = result.Text;
float confidence = result.Confidence;

关于speech-recognition - 为什么我的 Microsoft 语音识别结果的置信度总是等于 -1?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5220264/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com