语音识别

开源问答 技术问答 正文
如何改善sphinx4中文识别率低的问题
疯狂de攻城狮 发布于 02/24 08:52
阅读 73
收藏 1
答案 0
Sphinx-4 Sphinx

1.项目引入依赖包

edu.cmu.sphinx sphinx4-core 5prealpha-SNAPSHOT snapshots-repo https://oss.sonatype.org/content/repositories/snapshots false true

2.下载最新的中文声学模型和字典

https://sourceforge.net/projects/cmusphinx/files/Acoustic%20and%20Language%20Models/Mandarin/

cmusphinx-zh-cn-5.2.tar.gz

3.解压cmusphinx-zh-cn-5.2.tar.gz,并加入到项目resources目录。

4.执行代码

public class Speech2Text {
public static void main(String[] args) throws IOException {
Configuration configuration = new Configuration();
configuration.setAcousticModelPath(“resource:/cmusphinx-zh-cn-5.2/zh_cn.cd_cont_5000”);
configuration.setDictionaryPath(“resource:/cmusphinx-zh-cn-5.2/zh_cn.dic”);
configuration.setLanguageModelPath(“resource:/cmusphinx-zh-cn-5.2/zh_cn.lm.bin”);
StreamSpeechRecognizer recognizer = new StreamSpeechRecognizer(configuration);
InputStream stream = new FileInputStream(“E:/collection_0.wav”);
recognizer.startRecognition(stream);

    SpeechResult result;
    while ((result = recognizer.getResult()) != null) {
        System.out.format("Hypothesis: %s\n", result.getHypothesis());
    }
}

}

E:/collection_0.wav是一段教学音频文件,程序运行,能识别并输出中文文本,但就是识别率太低了。

添加链接描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值