evie-8/backup_uganda
Viewer • Updated • 30 • 26
How to use evie-8/speaker-segmentation-fine-tuned-backup-uganda-eng with Transformers:
# Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("evie-8/speaker-segmentation-fine-tuned-backup-uganda-eng", dtype="auto")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:
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)
More information needed
More information needed
The following hyperparameters were used during training:
| 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 |
Base model
pyannote/segmentation-3.0