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

Add hotwords support to Swift/Go/Python/C#/Kotlin APIs #260

Merged
merged 10 commits into from
Aug 31, 2023

Conversation

csukuangfj
Copy link
Collaborator

No description provided.

@csukuangfj csukuangfj changed the title Add hotwords support to Swift/Go/Python/C# APIs Add hotwords support to Swift/Go/Python/C#/Kotlin APIs Aug 31, 2023
@csukuangfj csukuangfj merged commit 401de81 into k2-fsa:master Aug 31, 2023
19 of 21 checks passed
@csukuangfj csukuangfj deleted the fix-hotwords branch August 31, 2023 05:40
@pkufool
Copy link
Collaborator

pkufool commented Aug 31, 2023

FYI, current implementation only support Chinese models trained on single characters.

@csukuangfj
Copy link
Collaborator Author

Here is an example hotword file:

https://huggingface.co/HalFTeen/sherpa-ncnn-hotwords-test/blob/main/hotwords.txt

保 护 屏
罗 北 以 线

CI test

https://github.com/k2-fsa/sherpa-ncnn/actions/runs/6033498241/job/16370260297#step:7:13724

2023-08-31 06:04:18 (run-test.sh:563:main) ----test modified_beam_search without hotwords---

五百
五百
五百
五百
五百去服
五百去服
五百去服
五百去服罗
五百去服罗北
五百去服罗北
五百去服罗北以县
五百去服罗北以县
五百去服罗北以县保
五百去服罗北以县保护
五百去服罗北以县保护
五百去服罗北以县保护平
五百去服罗北以县保护平

real	0m1.495s
user	0m0.824s
sys	0m0.752s

2023-08-31 06:04:19 (run-test.sh:577:main) ----test modified_beam_search with hotwords---

五百
五百
五百
五百
五百去服
五百去服
五百去服
五百去服罗北
五百去服罗北以
五百去服罗北以
五百去服罗北以线
五百去服罗北以线
五百去服罗北以线保护
五百去服罗北以线保护屏
五百去服罗北以线保护屏
五百去服罗北以线保护屏
五百去服罗北以线保护屏

real	0m1.309s
user	0m0.801s
sys	0m0.685s

Test wave:

https://huggingface.co/HalFTeen/sherpa-ncnn-hotwords-test/blob/main/hotwords.wav

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

Successfully merging this pull request may close these issues.

2 participants