🚀 マレーシア語ファインチューニング済みWhisper Base
マレーシア語のデータセットでWhisper Baseをファインチューニングしました。使用したデータセットは以下の通りです。
- IMDA STT, https://huggingface.co/datasets/mesolitica/IMDA-STT
- 疑似ラベル付きマレーシア語YouTube動画, https://huggingface.co/datasets/mesolitica/pseudolabel-malaysian-youtube-whisper-large-v3
- マレー語会話音声コーパス, https://huggingface.co/datasets/malaysia-ai/malay-conversational-speech-corpus
- Haqkiem TTSデータセット(これは非公開ですが、https://www.linkedin.com/in/haqkiem-daim/ からアクセスをリクエストできます)
- 疑似ラベル付きヌサンタラオーディオブック, https://huggingface.co/datasets/mesolitica/nusantara-audiobook
スクリプトはこちらにあります: https://github.com/mesolitica/malaya-speech/tree/malaysian-speech/session/whisper
Wandbはこちら: https://wandb.ai/huseinzol05/malaysian-whisper-base?workspace=user-huseinzol05
Wandbレポートはこちら: https://wandb.ai/huseinzol05/malaysian-whisper-base/reports/Finetune-Whisper--Vmlldzo2Mzg2NDgx
📚 ファインチューニングに使用した言語
ms
:マレー語(標準マレー語と現地のマレー語を含む)
en
:英語(標準英語とマングリッシュを含む)
🚀 クイックスタート
基本的な使用法
from transformers import AutoProcessor, AutoModelForSpeechSeq2Seq, pipeline
from datasets import Audio
import requests
sr = 16000
audio = Audio(sampling_rate=sr)
processor = AutoProcessor.from_pretrained("mesolitica/malaysian-whisper-base")
model = AutoModelForSpeechSeq2Seq.from_pretrained("mesolitica/malaysian-whisper-base")
r = requests.get('https://huggingface.co/datasets/huseinzol05/malaya-speech-stt-test-set/resolve/main/test.mp3')
y = audio.decode_example(audio.encode_example(r.content))['array']
inputs = processor([y], return_tensors = 'pt')
r = model.generate(inputs['input_features'], language='ms', return_timestamps=True)
processor.tokenizer.decode(r[0])
実行結果の例:
'<|startoftranscript|><|ms|><|transcribe|> Zamily On Aging di Vener Australia, Australia yang telah diadakan pada tahun 1982 dan berasaskan unjuran tersebut maka jabatan perangkaan Malaysia menganggarkan menjelang tahun 2005 sejumlah 15% penduduk kita adalah daripada kalangan warga emas. Untuk makluman Tuan Yang Pertua dan juga Alian Bohon, pembangunan sistem pendafiran warga emas ataupun kita sebutkan event adalah usaha kerajaan ke arah merealisasikan objektif yang telah digangkatkan<|endoftext|>'
高度な使用法
英語での予測例:
r = model.generate(inputs['input_features'], language='en', return_timestamps=True)
processor.tokenizer.decode(r[0])
実行結果の例:
<|startoftranscript|><|en|><|transcribe|> Assembly on Aging, Divina Australia, Australia, which has been provided in 1982 and the operation of the transportation of Malaysia's implementation to prevent the tourism of the 25th, 15% of our population is from the market. For the information of the President and also the respected, the development of the market system or we have made an event.<|endoftext|>
❓ 長い音声を予測する方法
音声を30秒ごとに分割し、各サンプルを予測する必要があります。