Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Obtaining Encoder Features #893

Closed
magacc1 opened this issue May 19, 2024 · 2 comments
Closed

Obtaining Encoder Features #893

magacc1 opened this issue May 19, 2024 · 2 comments

Comments

@magacc1
Copy link

magacc1 commented May 19, 2024

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!

@csukuangfj
Copy link
Collaborator

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

auto pair = model_->RunEncoder(std::move(x), std::move(states),
std::move(x_copy));

@magacc1 magacc1 closed this as completed Jun 13, 2024
@magacc1
Copy link
Author

magacc1 commented Jun 13, 2024

Thanks Fangjun!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants