ios - 语音识别:备用子串始终为空,大部分时间置信度为 0
问题描述
我正在尝试在 iOS 中使用语音识别,但我想我们没有交到朋友……
我已经设置了一个SFSpeechRegonizer
并相应地设置了它的委托。现在我实现委托方法如下:
func speechRecognitionTask(_ task: SFSpeechRecognitionTask, didHypothesizeTranscription transcription: SFTranscription) {
print("transcription: \(transcription.formattedString)")
print("alternativeSubstrings: \(transcription.segments.map { $0.alternativeSubstrings })")
print("confidence: \(transcription.segments.map { $0.confidence })")
}
每当调用委托方法时,都会打印出如下内容:
transcription: Space – the final frontier. These are the voyages…
alternativeSubstrings: [[], [], [], [], [], [], [], [], []]
confidence: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
转录很好。但是,alternativeSubstrings
数组始终为空,并且confidence
大多数时间值为 0。时不时地它们是非零的——但是当这种情况发生时它是不可预测的:
confidence: [0.56, 0.049, 0.558, 0.545, 0.476, 0.6, 0.654, 0.647, 0.829]
为什么没有alternativeSubstrings
,为什么confidence
大部分时间都是 0,我该如何解决这个问题?我 Apple 的语音库只是坏了或有什么问题?
解决方案
推荐阅读
- reactjs - react/typescript: Parameter 'props' implicitly has an 'any' type. After Using IProps interface
- substring - Teradata Substring fetch
- angularjs - 角度 js 向 ngDialog 显示获取的数据
- vba - 无法更新会议请求中的电子邮件正文
- react-native - 如何使用反应原生共享 api 共享图像
- css - 如何将元素放在悬停 CSS 上?
- javascript - 将下拉值传递给静态方法后面的代码
- angular - How to make input readonly, but still allow some keys to work
- javascript - 剑道网格导出到 Excel 下拉列表值而不是导出文件中的文本
- asp.net - 在 .NET 上使用 https 上传多个图像的问题