parlance / ctcdecode

PyTorch CTC Decoder bindings
MIT License
829 stars 245 forks source link

fix a prob pruning bug #107

Closed yuetz closed 5 years ago

ryanleary commented 5 years ago

Thanks for the contrib. Can you explain the bug?

yuetz commented 5 years ago

Thanks for the contrib. Can you explain the bug?

Sorry for my late replay. The range of "cutoff_prob" is [0, 1], so the cast "cutoff_prob < 0" doesn't work. "cutoff_len" always equals to the prob_step size. I fix the condition. When "log_cutoff_prob <0,( equel to cutoff_prob <1"), "cutoff_len" depands on "cutoff_prob" and "cutoff_top_n". When "log_cutoff_prob =0(equel to cutoff_prob =1)", "cutoff_len" depands on "cutoff_top_n".