Open-Speech-EkStep / vakyansh-wav2vec2-experimentation

Repository containing experimentation platform on how to train, infer on wav2vec2 models.
MIT License
85 stars 37 forks source link

Tuning wav2vec2 language model parameters #21

Open nome2050 opened 2 years ago

nome2050 commented 2 years ago

How can I tune my language model parameters of wav2vec2 (Kenlm)

My default paramters are :

BEAM = 128 beam_threshold = 25 LM_WEIGHT = 2 WORD_SCORE = -1 unk_weight = -np.inf sil_weight = 0 nbest = 1 criterion = 'ctc' labels = 'ltr'

is there any documentation of what should be the parameters?

harveenchadha commented 2 years ago

You ca tune the language model parameters by changing the lm_weight and word_score parameter.

Normally you can conduct combinations in the range of [0,3] for LM_WEIGHT and WORD_SCORE in the range of [-3,0]

Additionally increasing the beam width will give you better performance but also increase the inference time.