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

[BUG] OnlineRecognizer not outputting certain tokens after endpoint detection #1629

Open
lgarcia-trebe opened this issue Dec 18, 2024 · 0 comments

Comments

@lgarcia-trebe
Copy link

I'm testing speech recognition from a microphone with endpoint detection using the provided Python example, and I've found the following issue: when the first token of a segment is the same as the last token of the previous segment, such token is not included in the segment's result.

Examples:

(1) Input and expected result
0: THIS IS MY CAR
1: CARRYING SOMETHING

(1) Obtained result
0: THIS IS MY CAR
1: RYING SOMETHING

(2) Input and expected result
0: THIS IS MY CAR
1: CARWASH

(2) Obtained result
0: THIS IS MY CAR
1: WASH

Possible cause and workaround

It seems that the issue is tied to not properly resetting the stream on endpoint detection. If instead of calling recognizer.reset(stream) we directly create a new stream (stream = recognizer.create_stream()), the issue is no longer present. I've seen that calling reset doesn't reset the feature extractor, which might be the underlying cause.

I've recently started in this speech recognition world, and I'm not yet aware of all the technical implementation details, so I'm not sure what implications may arise from resetting the feature extractor too or from directly creating a new stream object. Any information or guidelines are appreciated.

Trained models used

Reproduced the issue with both a custom trained model and one of the repo's public models (sherpa-onnx-streaming-zipformer-en-2023-06-21).

@lgarcia-trebe lgarcia-trebe changed the title OnlineRecognizer not outputting certain tokens after endpoint detection [BUG] OnlineRecognizer not outputting certain tokens after endpoint detection Dec 18, 2024
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

1 participant