Views
No views yet
声息相通,文脉致远
| 能力 | 说明 |
|---|---|
| Transcription(转写) | 吴语语音 → 吴语文字。保留方言原味,适合文化记录和方言研究。 |
| Translation(翻译) | 吴语语音 → 普通话文字。适合字幕生成、内容理解等应用场景。 |
| 版本 | CER(字错率) | 策略 | 状态 |
|---|---|---|---|
| V01 | 0.6284 | 基线(Baseline),仅 AST 数据 | 存档 |
| V02 | 0.5407 | 调参(Hyperparameter Tuning),优化学习率和 LoRA rank | 存档 |
| V03 | 1.8230 | 合并 AST + ASR 数据,数据量 ×2.6 | 存档 |
| V05 | 0.4539 | 数据清洗 + LoRA r=32 | 存档 |
| V06 | 0.3600 | 阶跃训练(Staircase Training) | 前最佳 |
| V09 | 0.3467 | 最佳声学基底 + 干净翻译 | 当前最佳 ★ |
1import torch
2from transformers import WhisperProcessor, WhisperForConditionalGeneration
3from peft import PeftModel
4
5# 加载基础模型(Base Model)和吴语适配权重(LoRA Adapter)
6base_model = WhisperForConditionalGeneration.from_pretrained("openai/whisper-small")
7processor = WhisperProcessor.from_pretrained("kaiwang0574/whisper-wu")
8
9# 加载 LoRA 适配器
10model = PeftModel.from_pretrained(base_model, "kaiwang0574/whisper-wu")
11model.eval()
12
13# 对一段吴语音频进行转写
14import soundfile as sf
15audio, sr = sf.read("your_wu_dialect_audio.wav")
16inputs = processor(audio, sampling_rate=16000, return_tensors="pt")
17
18with torch.no_grad():
19 generated_ids = model.generate(
20 inputs.input_features,
21 language="zh",
22 task="transcribe",
23 )
24
25text = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
26print(text)<|translate|> 和 <|transcribe|> 标记区分翻译和转写任务@misc{whisper-wu-2026,
title={Whisper-Wu: LoRA-adapted Whisper for Wu Dialect Speech Recognition and Translation},
author={Kai Wang},
year={2026},
url={https://huggingface.co/kaiwang0574/whisper-wu}
}