🚀 フランス語用自動音声認識のために微調整されたwhisper-smallモデル
このモデルは、openai/whisper-small をベースに、mozilla-foundation/common_voice_11_0のフランス語データセットで微調整されたものです。モデルを使用する際には、音声入力が16Khzでサンプリングされていることを確認してください。このモデルは大文字小文字と句読点も予測します。

🚀 クイックスタート
このモデルは、フランス語の自動音声認識に特化しており、微調整により高精度な認識が可能です。使用する際は、音声入力のサンプリングレートを16Khzに設定する必要があります。
✨ 主な機能
- フランス語の自動音声認識に特化した微調整モデル
- 大文字小文字と句読点の予測が可能
- 16Khzの音声入力に最適化
📚 ドキュメント
性能
以下は、事前学習モデルの Common Voice 9.0、Multilingual LibriSpeech、Voxpopuli および Fleurs でのWER(単語誤り率)です。これらの結果は、元の 論文 に報告されています。
以下は、微調整されたモデルの Common Voice 11.0、Multilingual LibriSpeech、Voxpopuli および Fleurs でのWERです。これらの評価データセットは、フランス語のアルファベット文字のみを含むようにフィルタリングおよび前処理されており、アポストロフィ以外の句読点は削除されています。表の結果は WER (貪欲探索) / WER (ビーム幅5のビーム探索)
として報告されています。
💻 使用例
基本的な使用法
🤗 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-small-cv11-french", device=device)
pipe.model.config.forced_decoder_ids = pipe.tokenizer.get_decoder_prompt_ids(language="fr", task="transcribe")
ds_mcv_test = load_dataset("mozilla-foundation/common_voice_11_0", "fr", split="test", streaming=True)
test_segment = next(iter(ds_mcv_test))
waveform = test_segment["audio"]
generated_sentences = pipe(waveform, max_new_tokens=225)["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-small-cv11-french").to(device)
processor = AutoProcessor.from_pretrained("bofenghuang/whisper-small-cv11-french", language="french", task="transcribe")
model.config.forced_decoder_ids = processor.get_decoder_prompt_ids(language="fr", task="transcribe")
model_sample_rate = processor.feature_extractor.sampling_rate
ds_mcv_test = load_dataset("mozilla-foundation/common_voice_11_0", "fr", 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ライセンスの下で提供されています。