【问题标题】:How to get a CTM File from CMU Sphinx?如何从 CMU Sphinx 获取 CTM 文件?
【发布时间】:2015-12-14 04:00:09
【问题描述】:

我已经使用我的语言模型将我的语音解码为音素。我需要将语音分割成句子和单词。我知道,ctm 文件会有所帮助。谁能告诉我如何为特定语音生成 ctm 文件实例?

【问题讨论】:

    标签: speech-recognition cmusphinx phoneme srilm


    【解决方案1】:

    从识别器中转储单词时间的代码:

    int frame_rate = cmd_ln_int32_r(config, "-frate");
    ps_seg_t *iter = ps_seg_iter(ps, NULL);
    while (iter != NULL) {
        int32 sf, ef, pprob;
        float conf;
    
        ps_seg_frames(iter, &sf, &ef);
        pprob = ps_seg_prob(iter, NULL, NULL, NULL);
        conf = logmath_exp(ps_get_logmath(ps), pprob);
        printf("%s %.3f %.3f %f\n", ps_seg_word(iter), ((float)sf / frame_rate),
               ((float) ef / frame_rate), conf);
        iter = ps_seg_next(iter);
    }
    

    【讨论】:

    • 感谢代码!还有,如何获取给定语音实例的 CTM 文件?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-11-21
    • 1970-01-01
    • 1970-01-01
    • 2012-08-19
    • 2016-12-07
    • 1970-01-01
    相关资源
    最近更新 更多