Skip to content
New issue

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

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

Already on GitHub? # to your account

Disable strict hotword matching mode for offline transducer #1837

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

vsd-vector
Copy link
Contributor

@vsd-vector vsd-vector commented Feb 10, 2025

I noticed that for offline transducer strict_mode is True when traversing ContextGraph, but for online non-strict mode is used (see #638 ).

What is the rationale behind this?

In my testing, when using strict_mode the decoder sometimes "gets stuck" in the final state of the hotword graph, penalizing all tokens after the hotword. In other words, if we have sentence "he is my friend" and hotwords list contains "he", then sometimes decoder output is just "he" and remainder of the sentence is truncated. This is typically happens if weight is too large, but I would still consider such behaviour undesirable for ASR (not keyword spotter).

This PR proposes to disable strict hotword matching mode for offline transducer.
Also it introduces new variable, so that later this mode can be made configurable.

…roduces new variable, so that later this mode can be switched on in the runtime.
@csukuangfj
Copy link
Collaborator

@pkufool Please have a review.

@pkufool
Copy link
Contributor

pkufool commented Feb 17, 2025

@vsd-vector I would suggest to use non_strict for hotwords. So I think make strict mode false by default is enough, don't necessary to make it configurable.

@vsd-vector
Copy link
Contributor Author

vsd-vector commented Feb 25, 2025

@pkufool I removed the variable and replaced it with "false" constant value.

Copy link
Contributor

@pkufool pkufool left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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

Successfully merging this pull request may close these issues.

3 participants