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