库名称: transformers
语言:
- 越南语
许可证: mit
基础模型: openai/whisper-base
标签:
- 训练生成
- 语音转文本
- 音频转文字
- S2T
- STT
评估指标:
- 词错误率
模型索引:
- 名称: Whisper越南语基础版 - Nam Phung
成果: []
管道标签: 自动语音识别
Whisper越南语基础版V1.1:Nam Phung微调版 🚀
📝 简介
这是基于openai/whisper-base模型在100小时越南语语音数据上微调的版本。该模型旨在提升越南语自动语音识别(ASR)任务的转录准确性和鲁棒性,特别是在真实场景中的应用表现。
📊 微调结果
评估在包含多种地域口音和说话风格的保留测试集上进行。
📝 模型说明
Whisper基础模型是基于Transformer的序列到序列模型,专为语音识别和翻译任务设计。原始模型在超过68万小时的多语言标注音频数据上训练。本微调版本专注于越南语,旨在提升方言处理能力和转录准确率。
该模型需配合WhisperProcessor使用,将音频输入预处理为对数梅尔频谱图并解码为文本。
📁 数据集
- 总时长: 超过100小时高质量越南语语音
- 数据来源: 公开越南语数据集
- 格式: 16kHz WAV文件及对应文本转录
- 预处理: 音频标准化分段,文本清洗分词
🚀 使用指南
使用微调模型可访问: https://github.com/namphung134/np-asr-vietnamese
或按以下步骤操作:
-
安装依赖环境:
!pip install transformers torch librosa soundfile --quiet
import torch
import librosa
import soundfile as sf
from transformers import AutoModelForSpeechSeq2Seq, AutoProcessor, pipeline
print("环境配置完成!")
-
进行推理预测:
import torch
import librosa
from transformers import AutoProcessor, AutoModelForSpeechSeq2Seq
device = "cuda" if torch.cuda.is_available() else "cpu"
print(f"使用设备: {device}")
model_id = "namphungdn134/whisper-base-vi"
print(f"加载模型: {model_id}")
processor = AutoProcessor.from_pretrained(model_id)
model = AutoModelForSpeechSeq2Seq.from_pretrained(model_id).to(device)
forced_decoder_ids = processor.get_decoder_prompt_ids(language="vi", task="transcribe")
model.config.forced_decoder_ids = forced_decoder_ids
print(f"越南语强制解码ID: {forced_decoder_ids}")
audio_path = "example.wav"
print(f"加载音频: {audio_path}")
audio, sr = librosa.load(audio_path, sr=16000)
input_features = processor(audio, sampling_rate=16000, return_tensors="pt").input_features.to(device)
print(f"输入特征维度: {input_features.shape}")
print("生成转录文本中...")
with torch.no_grad():
predicted_ids = model.generate(input_features, forced_decoder_ids=forced_decoder_ids)
transcription = processor.batch_decode(predicted_ids, skip_special_tokens=True)[0]
print("📝 转录结果:", transcription)
print("预测ID序列:", predicted_ids[0].tolist())
⚠️ 局限性
- 本模型专为越南语优化,其他语言表现可能不佳
- 对重叠语音或背景噪声处理能力有限
- 训练数据未覆盖的方言变体可能影响准确率
📄 许可证
本模型采用MIT许可证。
📚 引用规范
若在研究或应用中使用本模型,请引用原始Whisper论文及本微调工作:
@article{Whisper2021,
title={Whisper: 多语言语音识别模型},
author={OpenAI},
year={2021},
journal={arXiv:2202.12064},
url={https://arxiv.org/abs/2202.12064}
}
@misc{title={Whisper越南语基础版V1.1 - Nam Phung},
author={Phùng Nam},
organization={DUT},
year={2025},
url={https://huggingface.co/namphungdn134/whisper-base-vi}
}
📬 联系方式
如有疑问、合作或建议,请联系[namphungdn134@gmail.com]。