Vorrapard's picture
Create README.md
6835feb verified
metadata
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.

Usage

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

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"))