3

Could anyone recommend a speech recognition library for python 3 which is completely offline and free? If so could you also add steps to installing this library. I have tried pocketsphinx but the live speech recognition is too inaccurate for what I would like.

2 Answers 2

1

You can try Kaldi, it is not easy to install, but it is more accurate than pocketsphinx. For local decoding you can use something like

https://github.com/alphacep/vosk-server/

the model is here http://kaldi-asr.org/models/m1

10
  • Thank you, I'll give it another go installing on Ubuntu because at this point I can't get it to work on Mac OS. If I can install Kaldi then I'll try the websocket. Thank you, if it works I will mark as answered.
    – user56979
    Aug 28, 2019 at 1:02
  • I can't get it to work. I installed Kaldi from here jrmeyer.github.io/asr/2016/01/26/Installing-Kaldi.html but the websocket can't find the directory voice data and won't build. So no idea anymore.
    – user56979
    Aug 31, 2019 at 1:42
  • You have to edit the actual kaldi path in Makefile Aug 31, 2019 at 8:33
  • OK thank you. I got past that error and then about five others but there is another one I'm stuck on. This is what I get...D1Ev' can not be used when making a shared object; recompile with -fPIC/usr/bin/ld: final link failed: Bad valuecollect2: error: ld returned 1 exit status. I get it while running make for the web-socket.
    – user56979
    Sep 1, 2019 at 1:10
  • You have to recompile Kaldi with --shared configure option Sep 1, 2019 at 10:59
0

OpenAI's Whisper (off-line, MIT license, Python 3.9, CLI) yields some highly accurate transcription. To use (tested on Ubuntu 20.04 x64 LTS):

conda create -y --name whisperpy39 python==3.9
conda activate whisperpy39
pip install git+https://github.com/openai/whisper.git 
sudo apt update && sudo apt install ffmpeg
whisper recording.wav
whisper recording.wav --model large

If using an Nvidia 3090 GPU, add the following after conda activate whisperpy39

pip install -f https://download.pytorch.org/whl/torch_stable.html
conda install pytorch==1.10.1 torchvision torchaudio cudatoolkit=11.0 -c pytorch

Performance info below.

Model inference time:

Size Parameters English-only model Multilingual model Required VRAM Relative speed
tiny 39 M tiny.en tiny ~1 GB ~32x
base 74 M base.en base ~1 GB ~16x
small 244 M small.en small ~2 GB ~6x
medium 769 M medium.en medium ~5 GB ~2x
large 1550 M N/A large ~10 GB 1x

WER on several corpus from https://cdn.openai.com/papers/whisper.pdf:

enter image description here

WER on several languages from https://github.com/openai/whisper/blob/main/language-breakdown.svg:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy