--- license: mit base_model: pyannote/segmentation-3.0 tags: - speaker-diarization - speaker-segmentation - generated_from_trainer datasets: - diarizers-community/callhome model-index: - name: speaker-segmentation-fine-tuned-callhome-spa results: [] --- # speaker-segmentation-fine-tuned-callhome-spa This model is a fine-tuned version of [pyannote/segmentation-3.0](https://huggingface.co/pyannote/segmentation-3.0) on the diarizers-community/callhome spa dataset. It achieves the following results on the evaluation set: - Loss: 0.5198 - Der: 0.1745 - False Alarm: 0.0739 - Missed Detection: 0.0687 - Confusion: 0.0319 ## Model description This segmentation model has been trained on Spanish data (Callhome) using [diarizers](https://github.com/huggingface/diarizers/tree/main). 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-spa') ``` To use it within a pyannote speaker diarization pipeline, load the [pyannote/speaker-diarization-3.1](https://huggingface.co/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 segmentation_model = segmentation_model.to_pyannote_model() pipeline._segmentation.model = segmentation_model.to(device) ``` You can now use the pipeline on audio examples: ```python from datasets import load_dataset # load dataset example dataset = load_dataset("diarizers-community/callhome", "spa", 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: 32 - eval_batch_size: 32 - seed: 42 - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08 - lr_scheduler_type: cosine - num_epochs: 5.0 ### Training results | Training Loss | Epoch | Step | Validation Loss | Der | False Alarm | Missed Detection | Confusion | |:-------------:|:-----:|:----:|:---------------:|:------:|:-----------:|:----------------:|:---------:| | 0.655 | 1.0 | 382 | 0.5330 | 0.1799 | 0.0680 | 0.0756 | 0.0364 | | 0.6293 | 2.0 | 764 | 0.5216 | 0.1747 | 0.0662 | 0.0746 | 0.0339 | | 0.6145 | 3.0 | 1146 | 0.5244 | 0.1770 | 0.0759 | 0.0686 | 0.0325 | | 0.5956 | 4.0 | 1528 | 0.5185 | 0.1734 | 0.0732 | 0.0687 | 0.0315 | | 0.5989 | 5.0 | 1910 | 0.5198 | 0.1745 | 0.0739 | 0.0687 | 0.0319 | ### Framework versions - Transformers 4.40.0 - Pytorch 2.2.2+cu121 - Datasets 2.18.0 - Tokenizers 0.19.1