🚀 whisper medium を CommonVoice-14.0 ファルシ語でファインチューニング
このリポジトリは、SpeechBrain内でCommonVoice(ファルシ語)でファインチューニングされたエンドツーエンドのwhisperモデルを使用して自動音声認識を行うために必要なすべてのツールを提供しています。より良い体験を得るために、SpeechBrainについてもっと学ぶことをおすすめします。
モデルのパフォーマンスは以下の通りです。
リリース |
テストCER |
テストWER |
GPU |
1-08-23 |
11.27 |
35.48 |
1xV100 32GB |
🚀 クイックスタート
✨ 主な機能
この自動音声認識(ASR)システムは、whisperのエンコーダー・デコーダーブロックで構成されています。
- 事前学習されたwhisper-mediumエンコーダーは凍結されています。
- 事前学習されたWhisperトークナイザーが使用されます。
- 事前学習されたWhisper-mediumデコーダー(openai/whisper-medium)がCommonVoiceのファルシ語データでファインチューニングされています。
- 得られた最終的な音響表現は貪欲デコーダーに渡されます。
このシステムは、16kHzでサンプリングされた録音(単チャンネル)で学習されています。コードは、transcribe_file を呼び出す際に必要に応じて自動的にオーディオを正規化します(リサンプリング + モノチャンネル選択)。
📦 インストール
まず、以下のコマンドでtranformersとSpeechBrainをインストールしてください。
pip install speechbrain transformers
SpeechBrainについて詳しく学ぶことをおすすめします。
💻 使用例
基本的な使用法
from speechbrain.inference.ASR import WhisperASR
asr_model = WhisperASR.from_hparams(source="speechbrain/asr-whisper-medium-commonvoice-fa", savedir="pretrained_models/asr-whisper-medium-commonvoice-fa")
asr_model.transcribe_file("speechbrain/asr-whisper-medium-commonvoice-fa/example-fa.mp3")
高度な使用法
GPUで推論を行うには、from_hparams
メソッドを呼び出す際に run_opts={"device":"cuda"}
を追加します。
学習方法
このモデルはSpeechBrainで学習されています。ゼロから学習するには、以下の手順に従ってください。
- SpeechBrainをクローンします。
git clone https://github.com/speechbrain/speechbrain/
- インストールします。
cd speechbrain
pip install -r requirements.txt
pip install -e .
- 学習を実行します。
cd recipes/CommonVoice/ASR/transformer/
python train_with_whisper.py hparams/train_fa_hf_whisper.yaml --data_folder=your_data_folder
学習結果(モデル、ログなど)はこちらで確認できます。
🔧 技術詳細
プロパティ |
詳細 |
モデルタイプ |
asr-whisper-medium-commonvoice-fa |
学習データ |
CommonVoice 10.0 (Farsi) |
評価指標 |
WER, CER |
📄 ライセンス
このモデルはApache 2.0ライセンスの下で提供されています。
制限事項
SpeechBrainチームは、このモデルを他のデータセットで使用した場合のパフォーマンスについて一切保証しません。
SpeechBrainの引用方法
@misc{SB2021,
author = {Ravanelli, Mirco and Parcollet, Titouan and Rouhe, Aku and Plantinga, Peter and Rastorgueva, Elena and Lugosch, Loren and Dawalatabad, Nauman and Ju-Chieh, Chou and Heba, Abdel and Grondin, Francois and Aris, William and Liao, Chien-Feng and Cornell, Samuele and Yeh, Sung-Lin and Na, Hwidong and Gao, Yan and Fu, Szu-Wei and Subakan, Cem and De Mori, Renato and Bengio, Yoshua },
title = {SpeechBrain},
year = {2021},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\\\\url{https://github.com/speechbrain/speechbrain}},
}
SpeechBrainについて
SpeechBrainはオープンソースの統合音声ツールキットです。シンプルで、非常に柔軟性が高く、使いやすく設計されています。様々なドメインで競争力のある、または最先端のパフォーマンスが得られます。
- ウェブサイト: https://speechbrain.github.io/
- GitHub: https://github.com/speechbrain/speechbrain