k2-fsa / sherpa

Speech-to-text server framework with next-gen Kaldi
https://k2-fsa.github.io/sherpa
Apache License 2.0
483 stars 97 forks source link

issue with Endpoint detection for fast_beam_search #437

Closed chiiyeh closed 12 months ago

chiiyeh commented 12 months ago

Endpointing with fast_beam_search ends up with very short segment compared to modified_beam_search and greedy_search. Took a look into the code and it seems that the num_trailing_blanks does not seem to get reset when a non-blank token is seen. (Missing a else condition to set p->num_trailing_blanks = 0; as suggested in https://github.com/k2-fsa/sherpa/issues/229)

https://github.com/k2-fsa/sherpa/blob/3d4a3321a8acfa276e6179a4c9aa81f12607996f/sherpa/csrc/online-transducer-fast-beam-search-decoder.cc#L115-L135

csukuangfj commented 12 months ago

Yes, you are right.

Could you create a pull-request to fix it?

chiiyeh commented 12 months ago

Okay!