sherpa-onnx
sherpa-onnx copied to clipboard
Obtaining Encoder Features
I'm looking to use some of the pretrained speech recognizers and compute their encoder output features in real-time.
When I'm looking at the API of _Recognizer / _sherpa_onnx.OnlineRecognizer as defined here
I see only the following methods, and cannot find a way to get access to specifically compute the encoder outputs: 'create_stream', 'decode_stream', 'decode_streams', 'get_result', 'is_endpoint', 'is_ready', 'reset'
Can anyone help provide pointers on how to get the encoder features, or find the code underneath decode_stream and break it down to compute the encoder results?
Thanks!
We don't provide such an API as general users don't need it.
Can anyone help provide pointers on how to get the encoder features
For the online transducers, you can take a look at https://github.com/k2-fsa/sherpa-onnx/blob/8af2af84664d3285ba452bf453bb928a3eb6e978/sherpa-onnx/csrc/online-recognizer-transducer-impl.h#L224-L225
Thanks Fangjun!