speaker-segmentation-fine-tuned-backup-uganda-eng
This model is a fine-tuned version of evie-8/speaker-segmentation-fine-tuned-callhome-eng on the evie-8/backup_uganda dataset. It achieves the following results on the evaluation set:
- Loss: 0.3139
- Der: 0.1059
- False Alarm: 0.0200
- Missed Detection: 0.0339
- Confusion: 0.0520
Model description
This segmentation model has been trained on English data (backup_uganda) using diarizers. It can be loaded with two lines of code:
from diarizers import SegmentationModel
segmentation_model = SegmentationModel().from_pretrained('evie-8/speaker-segmentation-fine-tuned-backup-uganda-eng')
To use it within a pyannote speaker diarization pipeline, load the pyannote/speaker-diarization-3.1 pipeline, and convert the model to a pyannote compatible format:
from pyannote.audio import Pipeline
import torch
device = torch.device("cuda:0") if torch.cuda.is_available() else torch.device("cpu")
# load the pre-trained pyannote pipeline
pipeline = Pipeline.from_pretrained("pyannote/speaker-diarization-3.1")
pipeline.to(device)
# replace the segmentation model with your fine-tuned one
model = segmentation_model.to_pyannote_model()
pipeline._segmentation.model = model.to(device)
# load dataset example
dataset = load_dataset("evie-8/backup_uganda", "eng", split="data")
sample = dataset[0]["audio"]
# pre-process inputs
sample["waveform"] = torch.from_numpy(sample.pop("array")[None, :]).to(device, dtype=model.dtype)
sample["sample_rate"] = sample.pop("sampling_rate")
# perform inference
diarization = pipeline(sample)
# dump the diarization output to disk using RTTM format
with open("audio.rttm", "w") as rttm:
diarization.write_rttm(rttm)
Intended uses & limitations
More information needed
Training and evaluation data
More information needed
Training procedure
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 0.001
- train_batch_size: 4
- eval_batch_size: 4
- seed: 42
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: cosine
- num_epochs: 3
Training results
Training Loss | Epoch | Step | Validation Loss | Der | False Alarm | Missed Detection | Confusion |
---|---|---|---|---|---|---|---|
0.0661 | 1.0 | 1065 | 0.3346 | 0.1149 | 0.0132 | 0.0510 | 0.0507 |
0.1333 | 2.0 | 2130 | 0.3214 | 0.1089 | 0.0194 | 0.0367 | 0.0528 |
0.2857 | 3.0 | 3195 | 0.3139 | 0.1059 | 0.0200 | 0.0339 | 0.0520 |
Framework versions
- Transformers 4.42.4
- Pytorch 2.3.1+cu121
- Datasets 2.20.0
- Tokenizers 0.19.1
- Downloads last month
- 13
Model tree for evie-8/speaker-segmentation-fine-tuned-backup-uganda-eng
Base model
pyannote/segmentation-3.0