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 cumstomized score for hotwords & add Finalize to stream #281

Merged
merged 10 commits into from
Mar 7, 2024

Conversation

pkufool
Copy link
Collaborator

@pkufool pkufool commented Nov 16, 2023

This PR mainly aims to fix the bug of deletions at the tail when the hotword phrases are long, it also adds a very useful feature, users now can cumstomized the boosting score for different phrases.

There are two issues here:

  1. We did not finalize the result (i.e. canceling the partial matching score).
  2. If the phrase is long, then the total boosting score will be large.

So the fix are:

  1. Add stream->Finalize() when finishing the decoding, (actually, if you are using real streaming services, you don't have to do that, because we finalize the stream when meetting endpoint internally).
  2. Using a non strict mode when search the aho-corasick (A little complicated if not fimilar with Aho-corasick, please see for code for details).

@pkufool pkufool requested a review from csukuangfj November 18, 2023 10:46
@20246688
Copy link

20246688 commented Mar 1, 2024

请问可以提供一个演示视频吗,因为设置热词经常出现这种情况,导致尾部不能识别

@pkufool
Copy link
Collaborator Author

pkufool commented Mar 1, 2024

请问可以提供一个演示视频吗,因为设置热词经常出现这种情况,导致尾部不能识别

Sorry,I forgot this PR,there are some other fixes to the hotwords, will push here later.

@20246688
Copy link

20246688 commented Mar 1, 2024

好的,期待简单明了的处理方式

@20246688
Copy link

20246688 commented Mar 5, 2024

请问提供的方法怎么使用?需要重新安装sherpa_ncnn库吗

@20246688
Copy link

20246688 commented Mar 5, 2024

如果是需要重新编译库,可不可以开个教程视频啊?因为我用的python操作sherpa-ncnn模型的,也是偶然在哔站看见的,完全不明白所谓的finalize在哪里使用

@pkufool
Copy link
Collaborator Author

pkufool commented Mar 5, 2024

如果是需要重新编译库,可不可以开个教程视频啊?因为我用的python操作sherpa-ncnn模型的,也是偶然在哔站看见的,完全不明白所谓的finalize在哪里使用

麻烦稍等一会儿,现在还不能用。

@20246688
Copy link

20246688 commented Mar 7, 2024

如果是需要重新编译库,可不可以开个教程视频啊?因为我用的python操作sherpa-ncnn模型的,也是偶然在哔站看见的,完全不明白所谓的finalize在哪里使用

麻烦稍等一会儿,现在还不能用。

嗯嗯,明白了

@pkufool
Copy link
Collaborator Author

pkufool commented Mar 7, 2024

如果是需要重新编译库,可不可以开个教程视频啊?因为我用的python操作sherpa-ncnn模型的,也是偶然在哔站看见的,完全不明白所谓的finalize在哪里使用

麻烦稍等一会儿,现在还不能用。

嗯嗯,明白了

现在应该可以了,等 CI 过了就合并。一会儿你可以试试。

@20246688
Copy link

20246688 commented Mar 7, 2024

您的意思是我可以试试git clone https://github.com/k2-fsa/sherpa-ncnn
cd sherpa-ncnn
python3 setup.py install?不需要修改python代码吗

@pkufool
Copy link
Collaborator Author

pkufool commented Mar 7, 2024

您的意思是我可以试试git clone https://github.com/k2-fsa/sherpa-ncnn cd sherpa-ncnn python3 setup.py install?不需要修改python代码吗

不需要
(稍等,测试 还没跑完,还没合并)

@20246688
Copy link

20246688 commented Mar 7, 2024 via email

@pkufool pkufool merged commit 3c7724c into k2-fsa:master Mar 7, 2024
20 of 22 checks passed
@20246688
Copy link

20246688 commented Mar 8, 2024

请问这个merge了,我需要做什么呢,重新下载git clone https://github.com/k2-fsa/sherpa-ncnn,然后编译吗

@pkufool
Copy link
Collaborator Author

pkufool commented Mar 8, 2024

请问这个merge了,我需要做什么呢,重新下载git clone https://github.com/k2-fsa/sherpa-ncnn,然后编译吗

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.

3 participants