Skip to content

ttop32/wav2vec2-live-japanese-translator

Repository files navigation

wav2vec2-live-japanese-translator

Real time speech recognition translator using wav2vec2 and google translate
uses finetuned facebook/wav2vec2-large-xlsr-53 and facebook/wav2vec2-large-960h-lv60-self
it detect speaker (WASAPI for output loopback) and microphone (MME)

download latest from Downloads

Result

result
result

Finetuned model detail

Test WER on Common Voice Japanese test data: 21.48%
Test CER on Common Voice Japanese test data: 9.82%

Fine-tuned facebook/wav2vec2-large-xlsr-53 on Japanese hiragana using

Required environment to run

conda create -n torch python=3.6   
conda activate torch    
conda install pytorch==1.9.1 torchvision torchaudio==0.9.0 cudatoolkit=11.1 -c pytorch -c nvidia -c conda-forge
pip install datasets==1.11.0  
pip install transformers==4.11.2  
pip install ipywidgets  
pip install jiwer  
pip install pykakasi  
pip install mecab-python3  
pip install unidic-lite

#gui
conda install pytorch==1.9.0 torchaudio==0.9.0 cudatoolkit=10.2 -c pytorch
pip install transformers==4.11.2  
pip install PySoundFile
pip install PyAudio-0.2.11-cp36-cp36m-win_amd64.whl
pip install webrtcvad
pip install googletrans==4.0.0rc1
pip install PyQt5
pip install scipy
pip install pyinstaller

Model finetune code

jp_train.ipynb

Run gui using python

python gui_handler.py

pyinstaller

pyinstaller gui_handler.py -y -n wav2vec2_live_japanese_translator --hidden-import=pytorch --collect-data torch --copy-metadata torch --copy-metadata tqdm --copy-metadata regex --copy-metadata sacremoses --copy-metadata requests --copy-metadata packaging --copy-metadata filelock --copy-metadata numpy --copy-metadata tokenizers --copy-metadata importlib_metadata  --copy-metadata dataclasses

Acknowledgement and References