Sphinx4 荷兰语模型不起作用
Sphinx4 Dutch Language Model not working
我刚刚从一个短文本文件创建了一个语言模型。我对英语和荷兰语都这样做,主要是为了通过减少可能性来减少识别时间。
我都使用 Sphinx 工具包和 basesphinx lm 到二进制转换器创建了它们。
可以在此处找到荷兰语模型:http://pastebin.com/txkxiAc6
英文的可以在这里找到:http://pastebin.com/fr3Epj5b
它们都很小,但英国人能认出它需要认出的一切。
荷兰人使用荷兰语 Voxforge 包和词典。英语使用 cmusphinx-en-us-8khz-5.2.tar.gz 和 pocketsphinx.
的默认词典
代码是这样的:
Public static main(){
configuration = new Configuration();
configuration.setAcousticModelPath("src/main/resources/"+language+"/model");
configuration.setDictionaryPath("src/main/resources/"+language+"/dict.dict");
configuration.setLanguageModelPath("src/main/resources/"+language+"/model.lm.bin");
context = new Context(configuration);
recognizer = context.getInstance(Recognizer.class);
recognizer.allocate();
----------GET INPUT STREAM AND SEND TO METHOD-------------
RecognizeText(inputstream,outputstream)
}
private static String RecognizeText(InputStream stream, OutputStream os) throws Exception {
context.setSpeechSource(stream, TimeFrame.INFINITE);
Result result;
while ((result = recognizer.recognize()) != null) {
SpeechResult speechResult = new SpeechResult(result);
return speechResult.getHypothesis();
}
return "";
}
'language' 变量可以设置为荷兰语或英语以获得正确的语言。英语有效,但荷兰语无效。
我的错误在哪里?我好像找不到。
Dutch Acoustic Model 文件夹包含以下内容:
feat.params
mdef
means
mixture_weights
noisedict
transition_matrices
variances
荷兰版很老,5年没更新了。我刚刚在 cmusphinx 网站上上传了一个新模型。
https://sourceforge.net/projects/cmusphinx/files/Acoustic%20and%20Language%20Models/Dutch/
它应该更准确,但它仍然只使用 13 小时的数据进行训练。英语模型经过 1000 多个小时的训练。我们需要更多转录的荷兰语数据。
我刚刚从一个短文本文件创建了一个语言模型。我对英语和荷兰语都这样做,主要是为了通过减少可能性来减少识别时间。 我都使用 Sphinx 工具包和 basesphinx lm 到二进制转换器创建了它们。 可以在此处找到荷兰语模型:http://pastebin.com/txkxiAc6 英文的可以在这里找到:http://pastebin.com/fr3Epj5b 它们都很小,但英国人能认出它需要认出的一切。
荷兰人使用荷兰语 Voxforge 包和词典。英语使用 cmusphinx-en-us-8khz-5.2.tar.gz 和 pocketsphinx.
的默认词典代码是这样的:
Public static main(){
configuration = new Configuration();
configuration.setAcousticModelPath("src/main/resources/"+language+"/model");
configuration.setDictionaryPath("src/main/resources/"+language+"/dict.dict");
configuration.setLanguageModelPath("src/main/resources/"+language+"/model.lm.bin");
context = new Context(configuration);
recognizer = context.getInstance(Recognizer.class);
recognizer.allocate();
----------GET INPUT STREAM AND SEND TO METHOD-------------
RecognizeText(inputstream,outputstream)
}
private static String RecognizeText(InputStream stream, OutputStream os) throws Exception {
context.setSpeechSource(stream, TimeFrame.INFINITE);
Result result;
while ((result = recognizer.recognize()) != null) {
SpeechResult speechResult = new SpeechResult(result);
return speechResult.getHypothesis();
}
return "";
}
'language' 变量可以设置为荷兰语或英语以获得正确的语言。英语有效,但荷兰语无效。 我的错误在哪里?我好像找不到。
Dutch Acoustic Model 文件夹包含以下内容:
feat.params
mdef
means
mixture_weights
noisedict
transition_matrices
variances
荷兰版很老,5年没更新了。我刚刚在 cmusphinx 网站上上传了一个新模型。
https://sourceforge.net/projects/cmusphinx/files/Acoustic%20and%20Language%20Models/Dutch/
它应该更准确,但它仍然只使用 13 小时的数据进行训练。英语模型经过 1000 多个小时的训练。我们需要更多转录的荷兰语数据。