Revise RNN-T pipeline streaming decoding logic (#2192)
Summary: Rather than apply SentencePiece's `decode` to directly convert each hypothesis's token id sequence to an output string, we convert each token id sequence to word pieces and then manually join the word pieces ourselves. This allows us to preserve leading whitespaces on output strings and therefore account for word breaks and continuations across token processor invocations, which is particularly useful when performing streaming ASR. https://user-images.githubusercontent.com/8345689/152093668-11fb775a-bf7b-4b1d-9516-9f8d5a9b6683.mov Versus the previous behavior visualized in https://github.com/pytorch/audio/issues/2093, the scheme here properly constructs words comprising multiple pieces. Pull Request resolved: https://github.com/pytorch/audio/pull/2192 Reviewed By: mthrok Differential Revision: D33936622 Pulled By: hwangjeff fbshipit-source-id: e550980c7d4cac9e982315508f793a6b816752e9
Showing
Please register or sign in to comment