🚀 フランス語用の自動音声認識のために微調整されたwhisper-large-v2モデル
このモデルは、openai/whisper-large-v2 を微調整したものです。2200時間以上のフランス語の音声オーディオを含む複合データセットで訓練されており、Common Voice 11.0、Multilingual LibriSpeech、Voxpopuli、Fleurs、Multilingual TEDx、MediaSpeech、および African Accented French のトレーニングと検証データセットを使用しています。モデルを使用する際には、音声入力が16Khzでサンプリングされていることを確認してください。このモデルは大文字小文字や句読点を予測しません。

🚀 クイックスタート
このモデルは、フランス語の自動音声認識タスクに最適化されています。以下のセクションでは、モデルの性能と使用方法について説明します。
✨ 主な機能
- フランス語の自動音声認識に特化した微調整済みモデル。
- 複数のデータセットを使用して訓練され、幅広いフランス語の音声に対応。
- 低いWER(Word Error Rate)で高精度な音声認識を実現。
📚 ドキュメント
性能
以下は、事前学習モデルの Common Voice 9.0、Multilingual LibriSpeech、Voxpopuli、および Fleurs でのWERです。これらの結果は、元の 論文 で報告されています。
以下は、微調整済みモデルの Common Voice 11.0、Multilingual LibriSpeech、Voxpopuli、および Fleurs でのWERです。これらの評価データセットは、フランス語のアルファベット文字のみを含むようにフィルタリングおよび前処理されており、アポストロフィ以外の句読点は削除されています。表の結果は、WER (greedy search) / WER (beam search with beam width 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-large-v2-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-large-v2-french").to(device)
processor = AutoProcessor.from_pretrained("bofenghuang/whisper-large-v2-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ライセンスの下で提供されています。