0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

whisperで音声文字おこし

0
Posted at

whisperで文字おこしを試してみました

whisperについて

ライセンス: MIT License
商用利用: 可能

モデルもダイジョブそうです

インストールなど

ダウンロード

git clone https://github.com/ggml-org/whisper.cpp.git

ビルド

cd whisper.cpp
cmake -B build
cmake --build build -j --config Release

モデルのダウンロード

日本語利用を考えていますので、ggml-large-v3-turbo.binを使うことにしました

sh ./models/download-ggml-model.sh large-v3-turbo

文字おこしの試し

こちらのmp3をダウンロードして試してみました

./build/bin/whisper-cli  -m ./models/ggml-large-v3-turbo.bin -f /Users/xxx/Downloads/青空朗読ワタシハジャガイモ.mp3 -otxt

出力結果は、mp3と同じディレクトリにtxtファイルができました

% cat 青空朗読ワタシハジャガイモ.mp3.txt
 村山和子作
 私はジャガイモ
 私はジャガイモ
 ジャガイモにシルクハットはどうですか
 私はジャガイモ
 ジャガイモに長いステッキどうですか
 私はジャガイモ
 ジャガイモにゲートの肩掛けどうですか
 私はジャガイモ
 ジャガイモにトモンのお靴はどうですか
 私はジャガイモ
 ジャガイモが街を歩いてもいいですか
 Yeah.

いやー素晴らしい。
これは使えそうです。

オプションなど

「-l ja」は日本語だよ!
「-t 6」とすると、6スレッド(CPUコアを見て指定)が可能
「--prompt "この会議はIT業界の専門用語や、Spring Boot、TypeScriptといった単語が含まれます"」こんなこともできそうです

ちなみに、ログをみると、ちゃんとGPUも使ってくれてそう

ggml_metal_init: allocating
ggml_metal_init: found device: Apple M5
ggml_metal_init: picking default device: Apple M5
ggml_metal_init: use fusion         = true
ggml_metal_init: use concurrency    = true
ggml_metal_init: use graph optimize = true
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?