🚀 ドイツ語の自動音声認識のためにファインチューニングされたwhisper-large-v2モデル
このモデルは、openai/whisper-large-v2 をファインチューニングしたもので、mozilla-foundation/common_voice_11_0のドイツ語データセットで学習されています。モデルを使用する際には、音声入力が16Khzでサンプリングされていることを確認してください。このモデルは、大文字小文字と句読点も予測します。

🚀 クイックスタート
このモデルは、ドイツ語の自動音声認識タスクに特化してファインチューニングされたものです。以下のセクションでは、モデルの性能と使用方法について説明します。
✨ 主な機能
- ドイツ語の自動音声認識に特化したファインチューニング済みモデルです。
- 大文字小文字と句読点の予測が可能です。
📚 ドキュメント
性能
以下は、Common Voice 9.0 での事前学習モデルのWER(単語誤り率)です。これらの結果は、元の論文で報告されています。
以下は、Common Voice 11.0 でのファインチューニング済みモデルのWERです。
💻 使用例
基本的な使用法
🤗 Pipelineを使用した推論
import torch
from datasets import load_dataset
from transformers import pipeline
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
pipe = pipeline("automatic-speech-recognition", model="bofenghuang/whisper-large-v2-cv11-german", device=device)
pipe.model.config.forced_decoder_ids = pipe.tokenizer.get_decoder_prompt_ids(language="de", task="transcribe")
ds_mcv_test = load_dataset("mozilla-foundation/common_voice_11_0", "de", split="test", streaming=True)
test_segment = next(iter(ds_mcv_test))
waveform = test_segment["audio"]
pipe.model.config.max_length = 225 + 1
generated_sentences = pipe(waveform)["text"]
🤗 低レベルAPIを使用した推論
import torch
import torchaudio
from datasets import load_dataset
from transformers import AutoProcessor, AutoModelForSpeechSeq2Seq
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
model = AutoModelForSpeechSeq2Seq.from_pretrained("bofenghuang/whisper-large-v2-cv11-german").to(device)
processor = AutoProcessor.from_pretrained("bofenghuang/whisper-large-v2-cv11-german", language="german", task="transcribe")
model.config.forced_decoder_ids = processor.get_decoder_prompt_ids(language="de", task="transcribe")
model_sample_rate = processor.feature_extractor.sampling_rate
ds_mcv_test = load_dataset("mozilla-foundation/common_voice_11_0", "de", split="test", streaming=True)
test_segment = next(iter(ds_mcv_test))
waveform = torch.from_numpy(test_segment["audio"]["array"])
sample_rate = test_segment["audio"]["sampling_rate"]
if sample_rate != model_sample_rate:
resampler = torchaudio.transforms.Resample(sample_rate, model_sample_rate)
waveform = resampler(waveform)
inputs = processor(waveform, sampling_rate=model_sample_rate, return_tensors="pt")
input_features = inputs.input_features
input_features = input_features.to(device)
generated_ids = model.generate(inputs=input_features, max_new_tokens=225)
generated_sentences = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
📄 ライセンス
このモデルは、Apache-2.0ライセンスの下で提供されています。