CoolFace
Modelpublic

diarizers-community/speaker-segmentation-fine-tuned-callhome-deu

sourceHugging Facemitupdated 2y agoView on Hugging Face
6likes129downloads
Model Card

<!-- This model card has been generated automatically according to the information the Trainer had access to. You should probably proofread and complete it, then remove this comment. -->

speaker-segmentation-fine-tuned-callhome-deu

This model is a fine-tuned version of pyannote/segmentation-3.0 on the diarizers-community/callhome deu dataset. It achieves the following results on the evaluation set:

  • —Loss: 0.3780
  • —Der: 0.1415
  • —False Alarm: 0.0724
  • —Missed Detection: 0.0490
  • —Confusion: 0.0201

Model description

This segmentation model has been trained on German data (Callhome) using diarizers. It can be loaded with two lines of code:

python
from diarizers import SegmentationModel

segmentation_model = SegmentationModel().from_pretrained('diarizers-community/speaker-segmentation-fine-tuned-callhome-deu')

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:

python

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)

You can now use the pipeline on audio examples:

python
# load dataset example
dataset = load_dataset("diarizers-community/callhome", "deu", 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
  • —trainbatchsize: 32
  • —evalbatchsize: 32
  • —seed: 42
  • —optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
  • —lrschedulertype: cosine
  • —num_epochs: 5.0

Training results

Training LossEpochStepValidation LossDerFalse AlarmMissed DetectionConfusion
0.46221.03300.38440.14390.06530.05620.0223
0.43062.06600.40040.15190.07630.05150.0241
0.40693.09900.37750.14070.07070.04960.0204
0.39494.013200.37710.14080.07100.04980.0200
0.38795.016500.37800.14150.07240.04900.0201

Framework versions

  • —Transformers 4.40.0
  • —Pytorch 2.2.2+cu121
  • —Datasets 2.18.0
  • —Tokenizers 0.19.1