System.Speech.Recognition替代置信度值问题 [英] System.Speech.Recognition alternates confidence values issue

查看:80
本文介绍了System.Speech.Recognition替代置信度值问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用"System.Speech.Recognition"在wav文件上执行语音识别的名称空间.麻烦的是我从Result获得的替代匹配.替代既没有根据置信度排序,也没有识别出的文本匹配 得分最高的替代方案.我的代码段:

I am using the "System.Speech.Recognition" namespace to perform speech recognition on a wav file. The trouble is that the alternate matches I get from Result.Alternates are neither sorted according to confidence, nor the recognized text matches the alternative with highest score. My code snippet:

Console.WriteLine("Recognized text = {0}, score = {1}", e.Result.Text, e.Result.Confidence); // Display the recognition alternates for the result. foreach (RecognizedPhrase phrase in e.Result.Alternates) { Console.WriteLine(" alt({0}) {1}", phrase.Confidence, phrase.Text); }

输出示例:

Recognized text =  She had said that fit and Gracie Wachtel are all year, score = 0.287724
alt(0.287724) She had said that fit and Gracie Wachtel are all year
alt(0.287724) she had said that fit and gracie wachtel are all year
alt(0.2955212) she had said that faith and gracie wachtel are all year
alt(0.287133) she had said that fit and gracie Wachtell are all year
alt(0.1644379) she had said that fit and gracie wachtel earlier
alt(0.3254312) jihad said that fit and gracie wachtel are all year
alt(0.2726361) she had said that fit and gracie wachtel are only are
alt(0.2867217) she had said that fail and gracie wachtel are all year
alt(0.2565451) she had said that fit and gracie watchful are all year
alt(0.2854537) she had said that fate and gracie wachtel are all year

知道为什么会发生吗?

推荐答案

Itamar Katz,

Hi Itamar Katz,

您使用了哪个版本的.NET Framework?在我这一边,候补人是有信心的.我正在使用.NET Framework 4.5.如果您使用.NET Framework 3.5,则对替代项不进行排序.如果候补人没有按照您的意愿排序,则可以使用linq来 排序.

Which versio of .NET Framework did you use? On my side, the alternates are order by confidence. I am using .NET Framework 4.5. If you use .NET Framework 3.5, the alternates are not sorted. If the alternates doesn't sort as you wish, you could use linq to sort it.

IEnumerable<RecognizedPhrase> alternates = e.Result.Alternates.OrderBy(s=>s.Confidence);

最好的问候,
王丽

Best Regards,
Li Wang


这篇关于System.Speech.Recognition替代置信度值问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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