Audio Classification
speechbrain
PyTorch
English
embeddings
Accent Identification
wav2vec2
XLSR
CommonAccent
English
Instructions to use anasmohammed/speech-accent-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- speechbrain
How to use anasmohammed/speech-accent-classifier with speechbrain:
# interface not specified in config.json
- Notebooks
- Google Colab
- Kaggle
File size: 555 Bytes
1a6455b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | from speechbrain.pretrained import EncoderClassifier
from transformers import AutoProcessor, Wav2Vec2Processor
class CustomEncoderWav2vec2Classifier(EncoderClassifier):
"""
This class inherits from `EncoderClassifier` to handle custom models.
The only difference is that it uses `AutoProcessor` to load the tokenizer.
"""
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.tokenizer = AutoProcessor.from_pretrained(
self.hparams.source, trust_remote_code=True
)
|