talkbank/callhome
Viewer • Updated • 660 • 521 • 45
How to use mhdp-africa/speaker-segmentation-fine-tuned-callhome with Transformers:
# Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("mhdp-africa/speaker-segmentation-fine-tuned-callhome", dtype="auto")This model is a fine-tuned version of pyannote/speaker-diarization-3.0 on the talkbank/callhome dataset. It achieves the following results on the evaluation set:
This model is a fine-tuned version of pyannote/speaker-diarization-3.0 for speaker segmentation, trained on the talkbank/callhome dataset.
It can be loaded using the code:
from pyannote.audio import Pipeline
import torch
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
# Load fine-tuned pipeline
pipeline = Pipeline.from_pretrained(
"Beijuka/speaker-segmentation-fine-tuned-callhome",
use_auth_token="your_huggingface_token" # Replace this!
)
pipeline.to(device)
# Run diarization
audio_file = "/path/to/audio.mp3"
diarization = pipeline(audio_file)
# Save RTTM output
with open("finetunemodel.rttm", "w") as f:
diarization.write_rttm(f)
# Print segments
print(diarization)
You can now use the pipeline on the train dataset:
# load dataset example
dataset = load_dataset("talkbank/callhome", '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)
The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss | Model Preparation Time | Der | False Alarm | Missed Detection | Confusion |
|---|---|---|---|---|---|---|---|---|
| 0.3959 | 1.0 | 362 | 0.4800 | 0.0071 | 0.1932 | 0.0575 | 0.0781 | 0.0577 |
| 0.4226 | 2.0 | 724 | 0.4797 | 0.0071 | 0.1918 | 0.0640 | 0.0723 | 0.0555 |
| 0.4117 | 3.0 | 1086 | 0.4726 | 0.0071 | 0.1872 | 0.0530 | 0.0789 | 0.0553 |
| 0.3875 | 4.0 | 1448 | 0.4671 | 0.0071 | 0.1852 | 0.0549 | 0.0769 | 0.0534 |
| 0.3646 | 5.0 | 1810 | 0.4710 | 0.0071 | 0.1872 | 0.0571 | 0.0747 | 0.0554 |
Base model
pyannote/speaker-diarization-3.0