File size: 825 Bytes
6835feb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
---
license: mit
datasets:
- google/speech_commands
base_model:
- facebook/wav2vec2-base
---
# Command Classifier

This is a lightweight classifier model trained on top of Wav2Vec2 features for classifying speech commands.

- **Base model**: `facebook/wav2vec2-base`
- **Fine-tuned model**: Lightweight linear classifier
- **Dataset**: [Google Speech Commands v0.02](https://arxiv.org/abs/1804.03209)

## Usage

You can use this classifier by combining it with Wav2Vec2 features. The classifier expects mean-pooled Wav2Vec2 hidden states.

```python
from transformers import Wav2Vec2Model
from command_classifier import CommandClassifier
import torch

wav2vec = Wav2Vec2Model.from_pretrained("facebook/wav2vec2-base")
classifier = CommandClassifier(num_classes=35)
classifier.load_state_dict(torch.load("pytorch_model.bin"))