Whisper Base Vi
模型简介
专为越南语优化的自动语音识别(ASR)模型,适用于语音转文本任务
模型特点
越南语优化
针对越南语特点进行专门微调,提升方言和口音识别能力
高效推理
基于Whisper基础架构,保持高效推理速度
真实场景适应
在多样化语音数据上训练,增强实际应用鲁棒性
模型能力
越南语语音识别
音频转文字
语音转录
使用案例
语音转录
会议记录
将越南语会议录音自动转为文字记录
词错误率16.9148%
媒体字幕生成
为越南语视频内容自动生成字幕
🚀 Whisper Base Vi V1.1:由Nam Phung针对越南语微调的Whisper Base模型
本模型是基于openai/whisper-base,在100小时越南语语音数据上微调得到的版本。其目标是提升越南语自动语音识别(ASR)任务的转录准确性和鲁棒性,尤其适用于现实场景。
模型信息
属性 | 详情 |
---|---|
模型类型 | 基于Transformer的序列到序列模型,专为自动语音识别和翻译任务设计 |
训练数据 | 超过100小时的高质量越南语语音数据,来源于公开越南语数据集,格式为16kHz的WAV文件及对应的文本转录 |
🚀 快速开始
你可以访问:https://github.com/namphung134/np-asr-vietnamese 来使用微调后的模型。
或者按照以下步骤操作:
- 安装所需依赖:
# Install required libraries
!pip install transformers torch librosa soundfile --quiet
# Import necessary libraries
import torch
import librosa
import soundfile as sf
from transformers import AutoModelForSpeechSeq2Seq, AutoProcessor, pipeline
print("Environment setup completed!")
- 使用模型进行推理:
import torch
import librosa
from transformers import AutoProcessor, AutoModelForSpeechSeq2Seq
device = "cuda" if torch.cuda.is_available() else "cpu"
print(f"Using device: {device}")
# Load processor and model
model_id = "namphungdn134/whisper-base-vi"
print(f"Loading model from: {model_id}")
processor = AutoProcessor.from_pretrained(model_id)
model = AutoModelForSpeechSeq2Seq.from_pretrained(model_id).to(device)
# config language and task
forced_decoder_ids = processor.get_decoder_prompt_ids(language="vi", task="transcribe")
model.config.forced_decoder_ids = forced_decoder_ids
print(f"Forced decoder IDs for Vietnamese: {forced_decoder_ids}")
# Preprocess
audio_path = "example.wav"
print(f"Loading audio from: {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: {input_features.shape}")
# Generate
print("Generating transcription...")
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:", transcription)
# Debug: Print token to check
print("Predicted IDs:", predicted_ids[0].tolist())
✨ 主要特性
- 基于Transformer架构的序列到序列模型,专为自动语音识别和翻译任务设计。
- 在超过680,000小时的多语言标注音频数据上进行训练。
- 微调版本专注于越南语,提升转录准确性并更好地处理当地方言。
- 与WhisperProcessor配合使用,将音频输入预处理为对数梅尔频谱图并解码为文本。
📦 安装指南
安装所需依赖:
# Install required libraries
!pip install transformers torch librosa soundfile --quiet
# Import necessary libraries
import torch
import librosa
import soundfile as sf
from transformers import AutoModelForSpeechSeq2Seq, AutoProcessor, pipeline
print("Environment setup completed!")
💻 使用示例
基础用法
import torch
import librosa
from transformers import AutoProcessor, AutoModelForSpeechSeq2Seq
device = "cuda" if torch.cuda.is_available() else "cpu"
print(f"Using device: {device}")
# Load processor and model
model_id = "namphungdn134/whisper-base-vi"
print(f"Loading model from: {model_id}")
processor = AutoProcessor.from_pretrained(model_id)
model = AutoModelForSpeechSeq2Seq.from_pretrained(model_id).to(device)
# config language and task
forced_decoder_ids = processor.get_decoder_prompt_ids(language="vi", task="transcribe")
model.config.forced_decoder_ids = forced_decoder_ids
print(f"Forced decoder IDs for Vietnamese: {forced_decoder_ids}")
# Preprocess
audio_path = "example.wav"
print(f"Loading audio from: {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: {input_features.shape}")
# Generate
print("Generating transcription...")
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:", transcription)
# Debug: Print token to check
print("Predicted IDs:", predicted_ids[0].tolist())
📚 详细文档
微调结果
- 词错误率(WER):16.9148
评估是在一个包含不同地区口音和说话风格的保留测试集上进行的。
数据集
- 总时长:超过100小时的高质量越南语语音数据
- 来源:公开越南语数据集
- 格式:16kHz的WAV文件及对应的文本转录
- 预处理:音频进行了归一化和分段处理,转录文本进行了清理和分词。
🔧 技术细节
Whisper Base模型是一个基于Transformer的序列到序列模型,专为自动语音识别和翻译任务设计。它在超过680,000小时的多语言标注音频数据上进行了训练。该模型的微调版本专注于越南语,旨在提高转录准确性并更好地处理当地方言。
此模型与WhisperProcessor配合使用,将音频输入预处理为对数梅尔频谱图并解码为文本。
⚠️ 重要提示
- 本模型是专门针对越南语进行微调的,在其他语言上的表现可能不佳。
- 对于重叠语音或嘈杂背景的处理能力有限。
- 如果训练数据中未充分涵盖某些强烈的方言变体,模型性能可能会下降。
📄 许可证
本模型遵循MIT许可证。
📚 引用
如果您在研究或应用中使用此模型,请按以下方式引用原始的Whisper模型和本次微调工作:
@article{Whisper2021,
title={Whisper: A Multilingual Speech Recognition Model},
author={OpenAI},
year={2021},
journal={arXiv:2202.12064},
url={https://arxiv.org/abs/2202.12064}
}
@misc{title={Whisper Base Vi V1.1 - Nam Phung},
author={Nam Phùng},
organization={DUT},
year={2025},
url={https://huggingface.co/namphungdn134/whisper-base-vi}
}
📬 联系我们
如有疑问、合作意向或建议,请通过 [namphungdn134@gmail.com] 与我们联系。
Voice Activity Detection
MIT
基于pyannote.audio 2.1版本的语音活动检测模型,用于识别音频中的语音活动时间段
语音识别
V
pyannote
7.7M
181
Wav2vec2 Large Xlsr 53 Portuguese
Apache-2.0
这是一个针对葡萄牙语语音识别任务微调的XLSR-53大模型,基于Common Voice 6.1数据集训练,支持葡萄牙语语音转文本。
语音识别 其他
W
jonatasgrosman
4.9M
32
Whisper Large V3
Apache-2.0
Whisper是由OpenAI提出的先进自动语音识别(ASR)和语音翻译模型,在超过500万小时的标注数据上训练,具有强大的跨数据集和跨领域泛化能力。
语音识别 支持多种语言
W
openai
4.6M
4,321
Whisper Large V3 Turbo
MIT
Whisper是由OpenAI开发的最先进的自动语音识别(ASR)和语音翻译模型,经过超过500万小时标记数据的训练,在零样本设置下展现出强大的泛化能力。
语音识别
Transformers 支持多种语言

W
openai
4.0M
2,317
Wav2vec2 Large Xlsr 53 Russian
Apache-2.0
基于facebook/wav2vec2-large-xlsr-53模型微调的俄语语音识别模型,支持16kHz采样率的语音输入
语音识别 其他
W
jonatasgrosman
3.9M
54
Wav2vec2 Large Xlsr 53 Chinese Zh Cn
Apache-2.0
基于facebook/wav2vec2-large-xlsr-53模型微调的中文语音识别模型,支持16kHz采样率的语音输入。
语音识别 中文
W
jonatasgrosman
3.8M
110
Wav2vec2 Large Xlsr 53 Dutch
Apache-2.0
基于facebook/wav2vec2-large-xlsr-53微调的荷兰语语音识别模型,在Common Voice和CSS10数据集上训练,支持16kHz音频输入。
语音识别 其他
W
jonatasgrosman
3.0M
12
Wav2vec2 Large Xlsr 53 Japanese
Apache-2.0
基于facebook/wav2vec2-large-xlsr-53模型微调的日语语音识别模型,支持16kHz采样率的语音输入
语音识别 日语
W
jonatasgrosman
2.9M
33
Mms 300m 1130 Forced Aligner
基于Hugging Face预训练模型的文本与音频强制对齐工具,支持多种语言,内存效率高
语音识别
Transformers 支持多种语言

M
MahmoudAshraf
2.5M
50
Wav2vec2 Large Xlsr 53 Arabic
Apache-2.0
基于facebook/wav2vec2-large-xlsr-53微调的阿拉伯语语音识别模型,在Common Voice和阿拉伯语语音语料库上训练
语音识别 阿拉伯语
W
jonatasgrosman
2.3M
37
精选推荐AI模型
Llama 3 Typhoon V1.5x 8b Instruct
专为泰语设计的80亿参数指令模型,性能媲美GPT-3.5-turbo,优化了应用场景、检索增强生成、受限生成和推理任务
大型语言模型
Transformers 支持多种语言

L
scb10x
3,269
16
Cadet Tiny
Openrail
Cadet-Tiny是一个基于SODA数据集训练的超小型对话模型,专为边缘设备推理设计,体积仅为Cosmo-3B模型的2%左右。
对话系统
Transformers 英语

C
ToddGoldfarb
2,691
6
Roberta Base Chinese Extractive Qa
基于RoBERTa架构的中文抽取式问答模型,适用于从给定文本中提取答案的任务。
问答系统 中文
R
uer
2,694
98