facebookresearch / fairseq

Facebook AI Research Sequence-to-Sequence Toolkit written in Python.
MIT License
30.19k stars 6.38k forks source link

Generate top k hypothesis for CTC decoding (infer.py) #4086

Open happydzhang opened 2 years ago

happydzhang commented 2 years ago

❓ Questions and Help

What is your question?

I am running evaluation for a phone recognition model using Wav2Vec + CTC decoding (runnin /speech_recognition/infer.py ). I am running using the follow code and I have got the reference and 1-best hypothesis like following. My question is, is there a way to also generate top-k hypothesis (HYPO1, HYPO2, ...HYPOK)? Any pointers are appreciated! Thanks

2021-12-21 05:08:22 | INFO | __main__ | HYPO:sil ay hh ae d f ey t sp ih n d eh m sp
2021-12-21 05:08:22 | INFO | __main__ | TARGET:sil ay hh ae r d f ey t sil ih n d eh m sil

Code

python3 /home/ec2-user/SageMaker/PronunciationEvaluation/fairseq/examples/speech_recognition/infer.py $DATASET --task audio_finetuning \--nbest 5 --path $CKPT --gen-subset test --results-path /home/ec2-user/SageMaker/PronunciationEvaluation/wav2vec2mdd/result --w2l-decoder viterbi \
--lm-weight 0 --word-score -1 --sil-weight 0 --criterion ctc --labels phn --max-tokens 640000 

What's your environment?

stale[bot] commented 2 years ago

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!