hubert large speech emotion recognition russian dusha finetuned

Providerxbgoose
Categoryaudio-classification
Licenseapache-2.0
Downloads251.5K
Stars0

Overview

The hubert-large-speech-emotion-recognition-russian-dusha is a specialized audio classification model fine-tuned from Meta's HuBERT Large architecture. Unlike general-purpose speech-to-text models, this version is optimized specifically for detecting emotional valence and arousal within Russian language audio. For developers building accessibility tools, customer experience analytics, or interactive voice agents, this model provides a robust way to extract sentiment from raw waveforms without requiring manual transcription first. It integrates easily into PyTorch-based pipelines and offers a significant precision boost over base HuBERT models when handling the nuanced prosody of Russian speech.

Highlights

  • Fine-tuned HuBERT Large for high-accuracy Russian emotion detection
  • Direct audio-to-emotion classification without needing text transcripts
  • Optimized for sentiment analysis in Russian voice interfaces
  • Apache-2.0 license ensures flexible commercial integration
  • Specialized in capturing nuanced Russian linguistic prosody

Usage

Install
# Install Hugging Face transformers
pip install transformers torch
SDK Usage
# Load model with transformers
from transformers import AutoModel, AutoTokenizer

model = AutoModel.from_pretrained("xbgoose/hubert-large-speech-emotion-recognition-russian-dusha-finetuned")
tokenizer = AutoTokenizer.from_pretrained("xbgoose/hubert-large-speech-emotion-recognition-russian-dusha-finetuned")

Hugging Face Download

We recommend downloading the model via the Hugging Face CLI or Hub SDK.

Guidance:Before downloading, install huggingface_hub with:

Guidance
pip install -U huggingface_hub

CLI Download

Download the full repository

Download the full repository
huggingface-cli download xbgoose/hubert-large-speech-emotion-recognition-russian-dusha-finetuned

Download a single file to a local folder (e.g. config.json into ./dir)

Download a single file to a local folder (e.g. config.json into ./dir)
huggingface-cli download xbgoose/hubert-large-speech-emotion-recognition-russian-dusha-finetuned config.json --local-dir ./dir

See the official docs for more CLI options

SDK Download

SDK Download
# 模型下载
from huggingface_hub import snapshot_download
model_dir = snapshot_download('xbgoose/hubert-large-speech-emotion-recognition-russian-dusha-finetuned')

Git Download

Make sure git-lfs is installed first

Git Download
git lfs install
git clone https://huggingface.co/xbgoose/hubert-large-speech-emotion-recognition-russian-dusha-finetuned

To skip LFS large-file downloads, use:

Skip LFS
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/xbgoose/hubert-large-speech-emotion-recognition-russian-dusha-finetuned

Model files are hosted on the Hugging Face Hub — download directly via HF CLI / SDK / Git, not through this site.

PyTorch / Transformers Usage

Install Transformers

Install Transformers
pip install -U transformers torch

Load the model and run inference

Load the model and run inference
from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained('xbgoose/hubert-large-speech-emotion-recognition-russian-dusha-finetuned')
tokenizer = AutoTokenizer.from_pretrained('xbgoose/hubert-large-speech-emotion-recognition-russian-dusha-finetuned')

Full Documentation

来源: HuggingFace

---
language:

  • ru

tags:
  • SER

  • speech

  • audio

  • russian

license: apache-2.0
pipeline_tag: audio-classification
base_model: facebook/hubert-large-ls960-ft
datasets:
  • xbgoose/dusha

---

HuBERT fine-tuned on DUSHA dataset for speech emotion recognition in russian language

The pre-trained model is this one - facebook/hubert-large-ls960-ft

The DUSHA dataset used can be found here

Fine-tuning

Fine-tuned in Google Colab using Pro account with A100 GPU

Freezed all layers exept projector, classifier and all 24 HubertEncoderLayerStableLayerNorm layers

Used half of the train dataset

Training parameters

  • 2 epochs
  • train batch size = 8
  • eval batch size = 8
  • gradient accumulation steps = 4
  • learning rate = 5e-5 without warm up and decay

Metrics

Achieved

  • accuracy = 0.86

  • balanced = 0.76

  • macro f1 score = 0.81

on test set, improving accucary and f1 score compared to dataset baseline

Usage

python
from transformers import HubertForSequenceClassification, Wav2Vec2FeatureExtractor
import torchaudio
import torch

feature_extractor = Wav2Vec2FeatureExtractor.from_pretrained("facebook/hubert-large-ls960-ft")
model = HubertForSequenceClassification.from_pretrained("xbgoose/hubert-speech-emotion-recognition-russian-dusha-finetuned")
num2emotion = {0: 'neutral', 1: 'angry', 2: 'positive', 3: 'sad', 4: 'other'}

filepath = "path/to/audio.wav"

waveform, sample_rate = torchaudio.load(filepath, normalize=True)
transform = torchaudio.transforms.Resample(sample_rate, 16000)
waveform = transform(waveform)

inputs = feature_extractor(
waveform,
sampling_rate=feature_extractor.sampling_rate,
return_tensors="pt",
padding=True,
max_length=16000 * 10,
truncation=True
)

logits = model(inputs['input_values'][0]).logits
predictions = torch.argmax(logits, dim=-1)
predicted_emotion = num2emotion[predictions.numpy()[0]]
print(predicted_emotion)

Join our Telegram