githubharald / CTCDecoder

Connectionist Temporal Classification (CTC) decoding algorithms: best path, beam search, lexicon search, prefix search, and token passing. Implemented in Python.
https://towardsdatascience.com/3797e43a86c
MIT License
817 stars 182 forks source link

Use log probabilities in beam search. #23

Closed a-sneddon closed 3 years ago

a-sneddon commented 3 years ago

Implemented log-space operations in beam search to avoid underflow when dealing with regular probabilities.

githubharald commented 3 years ago

thanks for your contribution. Using log-probs is a good idea 👍. There are a few minor things I suggest to change, to have as few if-else branches directly in the main decoding function, and to avoid having numpy print warning messages to the console.

githubharald commented 3 years ago

I anyway will push some changes to the repo, so I'll integrate your changes and will do the small modifications myself. Thanks again for your contribution 👍 .

a-sneddon commented 3 years ago

Thanks @githubharald for accepting the pull request. I've taken a look at the changes you've implemented since and they look good, thanks for your improvements and for maintaining the repo.