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

Model

7

stars

52

commits

1

linked in READMEs

Apr 25, 2024

updated

endpoints_compatible
generated_from_trainer
pyannet
safetensors
speaker-diarization
speaker-segmentation
tensorboard
transformers
Browse cluster: Multilingual Legal NLP Models

README

speaker-segmentation-fine-tuned-callhome-jpn

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

  • Loss: 0.7653
  • Der: 0.2311
  • False Alarm: 0.0477
  • Missed Detection: 0.1352
  • Confusion: 0.0482

Model description

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

from diarizers import SegmentationModel

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

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
segmentation_model = segmentation_model.to_pyannote_model()
pipeline._segmentation.model = segmentation_model.to(device)

You can now use the pipeline on audio examples:

from datasets import load_dataset
# load dataset example
dataset = load_dataset("diarizers-community/callhome", "jpn", 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 LossEpochStepValidation LossDerFalse AlarmMissed DetectionConfusion
0.59171.03280.78590.24090.05070.13690.0533
0.56162.06560.77380.23500.05300.13500.0471
0.53643.09840.77370.23580.04840.13680.0506
0.51214.013120.76260.23170.04830.13580.0475
0.51665.016400.76530.23110.04770.13520.0482

Framework versions

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

Contributors

kamilakesbi

52 commits

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

Model

7

stars

52

commits

1

linked in READMEs

Apr 25, 2024

updated

endpoints_compatible
generated_from_trainer
pyannet
safetensors
speaker-diarization
speaker-segmentation
tensorboard
transformers
Browse cluster: Multilingual Legal NLP Models

README

speaker-segmentation-fine-tuned-callhome-jpn

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

  • Loss: 0.7653
  • Der: 0.2311
  • False Alarm: 0.0477
  • Missed Detection: 0.1352
  • Confusion: 0.0482

Model description

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

from diarizers import SegmentationModel

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

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
segmentation_model = segmentation_model.to_pyannote_model()
pipeline._segmentation.model = segmentation_model.to(device)

You can now use the pipeline on audio examples:

from datasets import load_dataset
# load dataset example
dataset = load_dataset("diarizers-community/callhome", "jpn", 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 LossEpochStepValidation LossDerFalse AlarmMissed DetectionConfusion
0.59171.03280.78590.24090.05070.13690.0533
0.56162.06560.77380.23500.05300.13500.0471
0.53643.09840.77370.23580.04840.13680.0506
0.51214.013120.76260.23170.04830.13580.0475
0.51665.016400.76530.23110.04770.13520.0482

Framework versions

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

Contributors

kamilakesbi

52 commits