1from transformers import pipeline
2
3pipe = pipeline(
4 "automatic-speech-recognition",
5 model="kenrouse/whisper-large-v3-turbo-medical-ja",
6 device="cuda"
7)
8
9result = pipe("audio.wav", generate_kwargs={"language": "ja"})
10print(result["text"])
1using Whisper.net;
2
3var factory = WhisperFactory.FromPath("ggml-whisper-large-v3-turbo-medical-ja-q8_0.bin");
4using var processor = factory.CreateBuilder()
5 .WithLanguage("ja")
6 .Build();
7
8using var fileStream = File.OpenRead("audio.wav");
9await foreach (var segment in processor.ProcessAsync(fileStream))
10{
11 Console.WriteLine($"[{segment.Start} - {segment.End}] {segment.Text}");
12}
日本語医療用語辞書
DMiME(Dictionary of Medical terms in MEdical informatics)から抽出した医療用語を使用し、Azure Speech Service および Google Cloud TTS で音声を合成してトレーニングデータを作成しました。
1@misc{whisper-large-v3-turbo-medical-ja,
2 author = {kenrouse},
3 title = {Whisper Large-v3-Turbo Medical Japanese},
4 year = {2024},
5 publisher = {Hugging Face},
6 url = {https://huggingface.co/kenrouse/whisper-large-v3-turbo-medical-ja}
7}