MCPcopy Index your code
hub / github.com/dobby-seo/Wav2Keyword

github.com/dobby-seo/Wav2Keyword @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
5,584 symbols 17,228 edges 522 files 1,402 documented · 25%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Wav2Keyword

Wav2Keyword is keyword spotting(KWS) based on Wav2Vec 2.0. This model shows state-of-the-art in Speech commands dataset V1 and V2.

Preparation

  • PyTorch version >= 1.5.0
  • Python version >= 3.6
  • To install fairseq and develop locally:
git clone https://github.com/pytorch/fairseq
cd fairseq
pip install --editable ./

The pretrained Wav2Vec 2.0 base model not finetuned (https://dl.fbaipublicfiles.com/fairseq/wav2vec/wav2vec_small.pt) must exist in the model directory.

Training

python downstream_kws.py [pretrained model path] [dataset path] [saving model path]

And you can benchmark this model number of samples per each class.

python downstream_kws_benchmark.py [pretrained model path] [dataset path] [saving model path]

Model Architecture

With Wav2Vec 2.0 as the backbone, speech representation, output of transformer, is transferred to the structure of the model for speech commands recognition.

image

Performance

Accuracy of baseline models and proposed Wav2Keyword model on Google Speech Command Datasets V1 and V2 considering their 12 shared commands.

Dataset Accuracy (%)
Dataset V1 97.9
Dataset V2 98.5

Accuracy of baseline models and proposed Wav2Keyword model on Google Speech Command Dataset V2 with its 22 commands

Dataset Accuracy (%)
Dataset V12 97.8

Reference

[0] https://github.com/pytorch/fairseq/tree/master/examples/wav2vec

[1] https://arxiv.org/abs/1804.03209

[2] https://paperswithcode.com/sota/keyword-spotting-on-google-speech-commands

Citation

This paper has been submitted. If accept, will add.

@ARTICLE{9427206,  
  author={Seo, Deokjin and Oh, Heung-Seon and Jung, Yuchul},  
  journal={IEEE Access},   
  title={Wav2KWS: Transfer Learning from Speech Representations for Keyword Spotting},   
  year={2021},  
  pages={1-1},  
  doi={10.1109/ACCESS.2021.3078715}
}

Core symbols most depended-on inside this repo

size
called by 450
fairseq/data/list_dataset.py
get
called by 232
examples/simultaneous_translation/eval/server.py
split
called by 200
examples/simultaneous_translation/eval/agents/word_splitter.py
size
called by 146
examples/speech_recognition/data/asr_dataset.py
pad
called by 143
fairseq/data/dictionary.py
eos
called by 136
fairseq/data/dictionary.py
write
called by 84
examples/wav2vec/wav2vec_featurize.py
log
called by 78
fairseq/logging/progress_bar.py

Shape

Method 3,284
Function 1,591
Class 703
Route 4
Enum 2

Languages

Python86%
C++14%

Modules by API surface

fairseq/data/token_block_utils_fast.cpp391 symbols
fairseq/data/data_utils_fast.cpp376 symbols
fairseq/data/indexed_dataset.py75 symbols
tests/test_binaries.py72 symbols
fairseq/utils.py60 symbols
fairseq/models/fairseq_model.py60 symbols
tests/speech_recognition/asr_test_base.py57 symbols
tests/test_sequence_generator.py55 symbols
fairseq/data/iterators.py54 symbols
fairseq/token_generation_constraints.py53 symbols
fairseq/trainer.py52 symbols
fairseq/logging/progress_bar.py50 symbols

For agents

$ claude mcp add Wav2Keyword \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact