泉缘泉 发表于 2025-4-23 19:14:39

whisper-punctuator:零样本标点插入和大小写转换

whisper-punctuator:零样本标点插入和大小写转换

    whisper-punctuator Zero-shot multimodal punctuation insertion and truecasing using Whisperhttps://cdn-static.gitcode.com/Group427321440.svg 项目地点: https://gitcode.com/gh_mirrors/wh/whisper-punctuator   
项目介绍

whisper-punctuator 是一个开源项目,它利用 Whisper 语音识别模型实现了零样本标点插入和大小写转换功能。用户无需额外练习即可在 Whisper 支持的任何语言中使用该工具。通过输入未加标点的文本和对应的音频文件,whisper-punctuator 能自动为文本添加标点,并支持通过提示更改标点的风格。
项目技术分析

whisper-punctuator 的核心技术基于 Whisper 语音识别模型。Whisper 是一个经过大规模互联网标注音频数据练习的自动语音识别模型,其练习数据中包含了标点符号,使得模型学会了识别标点。whisper-punctuator 利用了 Whisper 的这一特性,通过处理音频和文本对,自动为文本添加标点。
项目工作流程如下:

[*]将音频文件通过 Whisper 编码器处理,天生编码器隐藏状态。
[*]利用这些隐藏状态,解码器天生包含标点符号的标志。
[*]终极的猜测使用束搜刮(beam search)方法,基于天生的标志的平均对数概率确定。
项目及技术应用场景

whisper-punctuator 实用于多种场景,尤其是在以下几种情况下特别有效:

[*]公开数据集的预处理:当处理公开数据集但数据集缺乏标点时,该工具能够帮助自动添加标点,进步数据质量。
[*]语音转录:在进行语音识别转录时,自动添加标点可以提拔转录文本的可读性。
[*]多语言处理:由于支持 Whisper 支持的所有语言,whisper-punctuator 可以用于多种语言环境的文本处理。
项目特点

whisper-punctuator 具有以下特点:

[*]零样本练习:无需额外练习数据即可使用。
[*]广泛语言支持:支持 Whisper 支持的所有语言。
[*]灵活的标点风格:通过提示,可以更改标点的风格。
[*]大小写转换:除了标点插入,项目还支持文本的大小写转换。
以下是项目的部分代码示例:
from whisper_punctuator import Punctuator

punctuator = Punctuator(language="en", punctuations=",.?", initial_prompt="Hello, everyone.")
punctuated_text = punctuator.punctuate(
    "tests/test.wav",
    "and do you know what the answer to this question now is the answer is no it is not possible to buy a cell phone that doesn't do too much so"
)
print(punctuated_text)
输出结果如下:
"And do you know what the answer to this question now is? The answer is no. It is not possible to buy a cell phone that doesn't do too much. So"
尽管 whisper-punctuator 在功能和便捷性上具有显著上风,但也存在一些局限性。例如,模型结果受练习数据集的影响,对于练习数据中罕见的标点符号可能识别效果不佳。此外,由于解码器是自回归的,猜测当前标志前的标点时可能无法看到所有未来的标志,导致错误插入标点。
在使用 whisper-punctuator 时,用户可能必要调解 --beam-size 和 --initial-prompt 参数以获得最佳效果。当前实现还不支持 Whisper 分词器中由多个标志组成的标点符号。
通过以上分析,可以看出 whisper-punctuator 是一个功能强盛的工具,能够为多种场景下的文本处理带来便利。对于必要进行语音识别转录、数据预处理和多语言文本处理的用户来说,whisper-punctuator 无疑是一个值得尝试的选择。
    whisper-punctuator Zero-shot multimodal punctuation insertion and truecasing using Whisperhttps://cdn-static.gitcode.com/Group427321440.svg 项目地点: https://gitcode.com/gh_mirrors/wh/whisper-punctuator   

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页: [1]
查看完整版本: whisper-punctuator:零样本标点插入和大小写转换