🚀 适用于乌干达语言的Whisper大模型
本模型是对whisper-large-v3
的适配版本,适用于乌干达广泛使用的以下语言:卢干达语、阿乔利语、卢格巴拉语、阿泰索语、尼扬科勒语、托罗语、卢马萨巴语、斯瓦希里语、卢索加语、基尼亚卢旺达语和英语(乌干达口音)。
✨ 主要特性
- 基于
whisper-large-v3
模型,适配乌干达多种语言。
- 训练时采用多种数据集,提升模型泛化能力。
- 训练过程中添加随机噪声和降采样,模拟真实语音场景。
📦 安装指南
文档未提及具体安装步骤,故跳过此章节。
💻 使用示例
基础用法
import transformers
import datasets
import torch
processor = transformers.WhisperProcessor.from_pretrained(
"Sunbird/asr-whisper-large-v3-salt")
model = transformers.WhisperForConditionalGeneration.from_pretrained(
"Sunbird/asr-whisper-large-v3-salt")
SALT_LANGUAGE_TOKENS_WHISPER = {
'eng': 50259,
'swa': 50318,
'ach': 50357,
'lgg': 50356,
'lug': 50355,
'nyn': 50354,
'teo': 50353,
'xog': 50352,
'ttj': 50351,
'kin': 50350,
'myx': 50349,
}
ds = datasets.load_dataset('Sunbird/salt', 'multispeaker-lug', split='test')
audio = ds[0]['audio']
sample_rate = ds[0]['sample_rate']
lang = 'lug'
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
input_features = processor(
audio, sampling_rate=sample_rate, return_tensors="pt").input_features
input_features = input_features.to(device)
predicted_ids = model.to(device).generate(
input_features,
language=processor.tokenizer.decode(SALT_LANGUAGE_TOKENS_WHISPER[lang]),
forced_decoder_ids=None)
transcription = processor.batch_decode(predicted_ids, skip_special_tokens=True)
print(transcription)
高级用法
文档未提及高级用法相关代码示例,故跳过此部分。
📚 详细文档
训练情况
该模型使用了SALT数据集、Common Voice(卢干达语、斯瓦希里语、基尼亚卢旺达语)、Google FLEURS和Makerere Yogera数据集进行训练。为了帮助模型在实际应用中更好地泛化,训练过程中添加了随机噪声,并随机降采样到8kHz以模拟电话语音。此外,还添加了从乌干达城市地区采样的街道噪声,以提高模型的鲁棒性。
性能指标
该模型在SALT文本以及Common Voice(斯瓦希里语、基尼亚卢旺达语)和Yogera(托罗语、卢索加语)的保留数据集上进行了评估,具体指标如下:
指标 |
英语 |
卢干达语 |
阿乔利语 |
卢格巴拉语 |
阿泰索语 |
尼扬科勒语 |
卢马萨巴语 |
卢索加语 |
斯瓦希里语 |
基尼亚卢旺达语 |
平均 |
WER |
0.018 |
0.142 |
0.195 |
0.189 |
0.202 |
0.234 |
0.461 |
0.453 |
0.069 |
0.111 |
0.207 |
CER |
0.009 |
0.029 |
0.045 |
0.045 |
0.051 |
0.043 |
0.092 |
0.081 |
0.015 |
0.031 |
0.044 |
模型信息
属性 |
详情 |
模型类型 |
whisper-large-v3-salt-plus-xog-myx-kin-swa-continued |
训练数据 |
SALT数据集、Common Voice(卢干达语、斯瓦希里语、基尼亚卢旺达语)、Google FLEURS和Makerere Yogera数据集 |
注意事项
- 该模型的使用方式与基础Whisper模型类似,会尝试自动检测语言并提供转录结果。但需要注意的是,语言检测并不总是准确的,手动指定语言可能会提高转录结果的准确性。
- 此模型支持的语言在基础Whisper模型中并不支持,因此使用格式略有不同。
🔧 技术细节
文档未提供足够详细的技术实现细节(少于50字的说明),故跳过此章节。
📄 许可证
文档未提及许可证信息,故跳过此章节。