Downloads · 30 days
24
12% of all-time downloads
kenrouse/whisper-medium-medical-ja
whisper-medium-medical-ja is a automatic speech recognition model from kenrouse. Use it when you need speech turned into text. It is set up for transformers. The card lists the license as apache-2.0.
日本語医療用語に特化してファインチューニングしたWhisper Mediumモデルです。
Downloads · 30 days
24
12% of all-time downloads
All-time downloads
194
Public
Parameters
764M
6 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors3.1 GB · 51%
From the Hugging Face model README
日本語医療用語に特化してファインチューニングしたWhisper Mediumモデルです。
このモデルは、OpenAIのWhisper Mediumをベースに、日本語医療用語(DMiME辞書:約41,600語)を用いてファインチューニングしました。電子カルテの音声入力や医療文書の音声認識に最適化されています。
| パラメータ | 値 |
|---|---|
| ベースモデル | openai/whisper-medium |
| パラメータ数 | 769M |
| 言語 | 日本語 |
| ファインチューニングデータ | DMiME(医学用語変換辞書) |
| 訓練サンプル数 | 66,015 |
| 検証サンプル数 | 8,251 |
| エポック数 | 3 |
| 学習率 | 1e-05 |
| 実効バッチサイズ | 16 |
| 精度 | FP16 |
TTS生成した医療テキスト音声(5サンプル)を用いて、オリジナルモデルとファインチューニング済みモデルを比較評価しました。
| Model | CER | WER |
|---|---|---|
| Original Whisper Medium | 0.2184 | 0.2184 |
| Fine-tuned (This Model) | 0.0978 | 0.0978 |
| 改善率 | +55.23% | +55.23% |
| カテゴリ | Original CER | Fine-tuned CER | 改善 |
|---|---|---|---|
| 循環器 | 0.185 | 0.130 | +30% |
| 腎臓内科 | 0.109 | 0.065 | +40% |
| 膠原病 | 0.214 | 0.048 | +78% |
| 消化器 | 0.273 | 0.091 | +67% |
| 神経内科 | 0.311 | 0.156 | +50% |
DMiME (Dictionary for Medical Input Method Editor) を使用しました。DMiMEは日本語医学用語変換辞書で、約41,600語の医療用語を含んでいます。
from transformers import WhisperProcessor, WhisperForConditionalGeneration
import librosa
# モデルとプロセッサの読み込み
processor = WhisperProcessor.from_pretrained("kenrouse/whisper-medium-medical-ja")
model = WhisperForConditionalGeneration.from_pretrained("kenrouse/whisper-medium-medical-ja")
# 音声ファイルの読み込み
audio, sr = librosa.load("audio.wav", sr=16000)
# 推論
input_features = processor(audio, sampling_rate=16000, return_tensors="pt").input_features
predicted_ids = model.generate(input_features, language="ja", task="transcribe")
transcription = processor.batch_decode(predicted_ids, skip_special_tokens=True)[0]
print(transcription)
from transformers import pipeline
pipe = pipeline(
"automatic-speech-recognition",
model="kenrouse/whisper-medium-medical-ja",
chunk_length_s=30,
device="cuda" # GPUを使用する場合
)
result = pipe("audio.wav", generate_kwargs={"language": "ja", "task": "transcribe"})
print(result["text"])
whisper.cpp で使用可能な GGML 形式も提供しています。ggml/ フォルダからダウンロードできます。
| Format | File | Size | Compression | Download |
|---|---|---|---|---|
| FP16 | ggml-whisper-medium-medical-ja.bin | 1,463 MB | - | Download |
| Q8_0 | ggml-whisper-medium-medical-ja-q8_0.bin | 785 MB | 46% | Download |
| Q5_0 | ggml-whisper-medium-medical-ja-q5_0.bin | 514 MB | 65% | Download |
# whisper.cpp をクローン
git clone https://github.com/ggerganov/whisper.cpp
cd whisper.cpp
# ビルド
make
# モデルをダウンロード(Q8_0推奨:精度とサイズのバランスが良い)
wget https://huggingface.co/kenrouse/whisper-medium-medical-ja/resolve/main/ggml/ggml-whisper-medium-medical-ja-q8_0.bin -O models/ggml-medium-medical-ja-q8_0.bin
# 推論実行
./main -m models/ggml-medium-medical-ja-q8_0.bin -l ja -f audio.wav
| Format | Accuracy | Speed | Memory | Recommended Use |
|---|---|---|---|---|
| FP16 | Best | Baseline | High | 高精度が必要な場合 |
| Q8_0 | Very Good | Faster | Medium | 推奨: バランス重視 |
| Q5_0 | Good | Fastest | Low | メモリ制限がある場合 |
@misc{whisper-medium-medical-ja,
author = {kenrouse},
title = {Whisper Medium Fine-tuned for Japanese Medical Speech Recognition},
year = {2024},
publisher = {Hugging Face},
url = {https://huggingface.co/kenrouse/whisper-medium-medical-ja}
}
Apache 2.0