harvard-edge / multilingual_kws

Few-shot Keyword Spotting in Any Language and Multilingual Spoken Word Corpus
163 stars 37 forks source link

How to train it for more than one target_keyword? #36

Closed twshen2000 closed 7 months ago

twshen2000 commented 2 years ago

Thanks!

DCNemesis commented 2 years ago

I'm also looking to do this. I see there are batch methods, but the prep steps are not clear.

turinaf commented 7 months ago

Same here, I wanted to train for more than one target keywords. @mmaz Anyone figured how to do it yet? @twshen2000 @DCNemesis Thank you in advance

mmaz commented 7 months ago

Thanks for checking our work out. We did not include documentation or examples for training on multiple targets, but it's fairly straightforward to add. The main change needed is to increase the (currently hardcoded) number of target categories to be greater than 3 (which represent the categories: silence/background, unknown, and the number of target keywords). I would suggest starting with our tutorial colab and then changing transfer_learning.transfer_learn() to include CATEGORIES as a non-hardcoded argument here: https://github.com/harvard-edge/multilingual_kws/blob/5823b01f13104f45694e419aeb26a37c547914af/multilingual_kws/embedding/transfer_learning.py#L46-L53