Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-- #36

Open
YYUUUY opened this issue Mar 4, 2021 · 3 comments
Open

-- #36

YYUUUY opened this issue Mar 4, 2021 · 3 comments

Comments

@YYUUUY
Copy link

YYUUUY commented Mar 4, 2021

--

@mailong25
Copy link
Owner

mailong25 commented Mar 5, 2021

Currently working on that. If you want to decode using transformer LM for English. Please do the following:

mkdir trans_LM ; cd trans_LM
wget https://github.com/mailong25/self-supervised-speech-recognition/blob/master/examples/lm_librispeech_word_transformer.dict
wget https://dl.fbaipublicfiles.com/wav2letter/sota/2019/lm/lm_librispeech_word_transformer.pt
wget https://github.com/mailong25/self-supervised-speech-recognition/blob/master/examples/dict.txt
cd ...

Then run the inference as follow:

from stt import Transcriber
transcriber = Transcriber(pretrain_model = 'path/to/pretrain.pt', finetune_model = 'path/to/finetune.pt', 
                          dictionary = 'path/to/dict.ltr.txt',
                          lm_type = 'fairseqlm',
                          lm_lexicon = 'path/to/trans_LM/lm_librispeech_word_transformer.dict,
                          lm_model  = 'path/to/trans_LM/lm_librispeech_word_transformer.pt,
                          lm_weight = 1.5, word_score = -1, beam_size = 50)
hypos = transcriber.transcribe(['path/to/wavs/0_1.wav','path/to/wavs/0_2.wav'])
print(hypos)

@mailong25
Copy link
Owner

mailong25 commented Mar 5, 2021

The pre-train model should be the model with no fine-tuning on the labeled data
https://dl.fbaipublicfiles.com/fairseq/wav2vec/wav2vec_vox_new.pt

@YYUUUY
Copy link
Author

YYUUUY commented Mar 8, 2021

@mailong25 Thank you

@YYUUUY YYUUUY changed the title how to finetune the transformer LM -- Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants