gpt4 book ai didi

ios - OpenEars 语音识别将其他单词检测为正确单词

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

我在我的应用程序中使用 OpenEars 框架来检测语音识别。这个想法是听几个单词,然后根据所说的单词执行一些操作。嗯,识别有效并且单词被检测到,但问题是对于单词“SNAPPIE”我遇到了一些问题 - 其他听起来不像它的单词也会被识别为“SNAPPIE”,有时即使我咳嗽。这是我用来设置监听器的一段代码:

private func setupOpenEars() {

_openEarsEventsObserver = OEEventsObserver()
_openEarsEventsObserver.delegate = self

OEPocketsphinxController.sharedInstance().disablePreferredBufferSize = true

do {
try OEPocketsphinxController.sharedInstance().setActive(true)
} catch let error {
print("There was an error setting Pocketsphinx as active: \(error.localizedDescription)")
}

let grammarDictionary = ["ThisCanBeSaidOnce": [ "SNAPPIE", "TAKE SNAPSHOT" ]]
let languageModelGenerator = OELanguageModelGenerator()
let fileName = "FirstOpenEarsDynamicLanguageModel"
let error = languageModelGenerator.generateGrammar(from: grammarDictionary, withFilesNamed: fileName, forAcousticModelAtPath: OEAcousticModel.path(toModel: "AcousticModelEnglish"))

if let languageError = error {
print("Dynamic language generator reported error: \(languageError.localizedDescription)")
} else {
_pathToGeneratedLanguageModel = languageModelGenerator.pathToSuccessfullyGeneratedLanguageModel(withRequestedName: fileName)
_pathToGeneratedDictionary = languageModelGenerator.pathToSuccessfullyGeneratedDictionary(withRequestedName: fileName)
}

_correctPathToMyLanguageModelFile = "\(NSSearchPathForDirectoriesInDomains(FileManager.SearchPathDirectory.cachesDirectory, FileManager.SearchPathDomainMask.userDomainMask, true)[0])/\(fileName).gram"
OEPocketsphinxController.sharedInstance().vadThreshold = 3.5
}

这是否可能是一个问题,因为“SNAPPIE”实际上不是一个“有效”单词?

最佳答案

您可以使用任何在线随机单词生成器工具创建随机单词列表,然后将您想要识别的特定关键字附加到词汇表中。这将提高您的特定关键字的识别度。不过,您仍然需要将假设文本与关键字列表进行比较,但大多数情况下解决方案已经足够好了。

关于ios - OpenEars 语音识别将其他单词检测为正确单词,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44301233/

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