【问题标题】:How to Access the Confidence on Pocket Sphinx Transcription如何获得对袖珍狮身人面像转录的信心
【发布时间】:2019-08-04 22:48:38
【问题描述】:

我正在使用 sphinx 将音频转换为文本,但我找不到如何访问每个单词的置信度分数

我能够访问转录输出,但无法获得模型背后的估计概率。这感觉很基本,但我找不到合适的文档。我应该在下面添加什么?

test = sr.AudioFile(audio_file)
Recon = sr.Recognizer()

with test as source:
    test_audio = Recon.record(source)
text = Recon.recognize_sphinx(test_audio,language = 'en-US')```

【问题讨论】:

    标签: python speech-recognition pocketsphinx


    【解决方案1】:

    当前版本的speech-recognition 不返回置信结果。如果你看implementation

    def recognize_sphinx(...):
       ...
       # return results
       hypothesis = decoder.hyp()
       if hypothesis is not None: return hypothesis.hypstr
       raise UnknownValueError()  # no transcriptions available
    

    您将看到仅返回文本结果 (hypothesis.hypstr),而置信度为 hypothesis.prob。一个快速的解决方法是在单独安装 pocketsphinx 后复制粘贴 entire method

    pip install pocketsphinx

    【讨论】:

    • 您能否详细说明复制粘贴整个方法是什么意思?
    • 我的意思是点击链接,复制源代码,然后将其粘贴到您的项目中。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-10
    • 1970-01-01
    • 1970-01-01
    • 2016-10-04
    • 1970-01-01
    相关资源
    最近更新 更多