BUTSpeechFIT/SOT-DiCoW

Multi-talker ASR based on DiCoW with Serialized Output Training

21

stars

2

commits

Python

primary language

Sep 18, 2025

updated

README

SOT-DiCoW

This repository contains the official implementation of SA-DiCoW (submitted to ICASSP 2026).

This repository is a fork of the previous work TS-ASR Whisper available on GitHUB.

Setup

  1. Clone the repository: git clone ...; cd ...
  2. Setup python environment (using conda or virtual environment):
  3. Install packages: pip install -r requirements.txt
  4. Change all the paths in configs/local_paths.sh (variables are explained below) based on your setup
  5. Change paths in scripts/data/prepare.sh if needed (by default, data is going to be prepared and saved to ./data) and execute it to prepare the data
  6. Run the code

Usage

Our codebase uses Hydra configuration package. All config yaml files are located in ./configs. The base configuration file with default values is configs/base.yaml (all the parameters are explained below).

To replicate the ASRU experiments, please run one of these commands:

# local node
python src/main.py +asru=sot_dicow/sot_dicow
torchrun --standalone --nnodes=1 --nproc-per-node=4 src/main.py +asru=sot_dicow/sot_dicow

# SGE
CFG="+asru=sot_dicow/sot_dicow" qsub scripts/training/submit_sge.sh

# PBS
CFG="+asru=sot_dicow/sot_dicow" qsub scripts/training/submit_pbs.sh

# SLURM
sbatch scripts/training/submit_slurm.sh +asru=sot_dicow/sot_dicow

Config Details

As you can see above, the configs are not specified via yaml file paths. Instead, Hydra uses so-called "config groups". All of our config files contain # @package _global_ on the first line, which specifies that the given values are overwriting the global default values specified in ./configs/base.yaml. If the line is not present in the config yaml file, Hydra will produce a nested object based on the relative file path.

Furthermore, none of the YAML config files contain any paths, as we strived for maximal inter-cluster/setup compatibility. Instead, Hydra package substitutes shell variables

Config Params

BASH Variables

Parameters are described in configs/local_paths.sh. Edit the values accordingly.

YAML Config Variables

ParameterTypeDefault ValueDescription
data.audio_path_prefixstring$AUDIO_PATH_PREFIXPrefix to add to audio paths.
data.audio_path_prefix_replacementstring$AUDIO_PATH_PREFIX_REPLACEMENTPrefix to replace in audio paths.
data.cache_features_for_devboolfalseWhether to cache features for the development set.
data.dataset_weightslist|nullnullWeights to assign to different datasets.
data.dev_datasetstring$NSF_DEV_DATA_PATHPath to the development dataset.
data.dev_decoding_samplesint1000Number of samples to use for decoding during development.
data.do_augmentboolfalseWhether to apply data augmentation.
data.empty_transcripts_ratiofloat0.0Ratio of training samples with empty transcripts.
data.eval_cutsetslist of strings-List of paths to evaluation cutsets.
data.eval_datasetstring$NSF_EVAL_DATA_PATHPath to the evaluation dataset.
data.eval_text_normstring"whisper_nsf"Text normalization method for evaluation data.
data.libri_dev_cached_pathstring$LIBRI_DEV_CACHED_PATHPath to cached LibriSpeech development data.
data.libri_train_cached_pathstring$LIBRI_TRAIN_CACHED_PATHPath to cached LibriSpeech training data.
data.mask_inputsboolfalseWhether to mask input data.
data.max_l_cropint0Maximum number of tokens to crop from the left.
data.max_r_cropint0Maximum number of tokens to crop from the right.
data.musan_noisesstring$MUSAN_PATHPath to the MUSAN noise dataset for data augmentation.
data.path_to_store_t_spk_embedstring|nullnullPath to store target speaker embeddings.
data.random_sentence_l_crop_pfloat0.0Probability of random left cropping of sentences.
data.random_sentence_r_crop_pfloat0.0Probability of random right cropping of sentences.
data.train_cutsetslist of strings-List of paths to training cutsets (pre-processed data segments).
data.train_text_normstring"whisper_nsf"Text normalization method for training data.
data.train_with_diar_outputsstring|nullnullWhether to train with diarization outputs.
data.use_libriboolfalseWhether to use the LibriSpeech dataset.
data.use_random_segmentationboolfalseWhether to use random segmentation of audio.
data.use_timestampsbooltrueWhether to use timestamps in the data.
data.vad_from_alignmentsboolfalseWhether to use Voice Activity Detection (VAD) from alignments.
decoding.condition_on_prevboolfalseWhether to condition on previous tokens during decoding.
decoding.decoding_ctc_weightfloat0.0Weight of CTC during decoding.
decoding.length_penaltyfloat|nullnullLength penalty applied during decoding.
experimentstring"DEFAULT_EXPERIMENT"Name of the experiment or configuration preset.
hydra.output_subdirstring|nullnullSubdirectory for Hydra outputs.
model.apply_fddt_to_n_layersint-1Number of layers to apply the FDDT to (-1 means all layers).
model.ctc_weightfloat0.3Weight of the Connectionist Temporal Classification (CTC) loss in the loss function.
model.embed_extractor_model_pathstring|nullnullPath to a model for extracting embeddings, if any.
model.prefixes_to_preheatlist of strings-List of model parameter prefixes to preheat (initialize or warm up).
model.pretrained_encoderstring|nullnullPath to a pre-trained encoder to initialize from, if any.
model.reinit_encoder_fromstring|nullnullPath to reinitialize the encoder from a specific checkpoint.
model.reinit_fromstring|nullnullPath to reinitialize the entire model from a specific checkpoint.
model.shift_pos_embedsboolfalseWhether to shift positional embeddings in the model.
model.fddt_bias_onlyboolfalseIf true, only the bias parameters are used in the FDDT.
model.fddt_initstring"disparagement"Method to initialize the FDDT parameters.
model.fddt_is_diagonalbooltrueIf set to true, the FDDT is diagonal.
model.fddt_use_non_targetbooltrueWhether to use non-target frames in the FDDT.
model.fddt_use_overlapbooltrueWhether to use overlapping frames in the FDDT.
model.fddt_use_silencebooltrueWhether to use silence frames in the FDDT.
model.fddt_use_targetbooltrueWhether to use target frames in the FDDT.
model.use_qk_biasingboolfalseWhether to use query-key biasing in the attention mechanism.
model.whisper_modelstring"openai/whisper-small.en"Name or path of the pre-trained Whisper model to use.
training.auto_find_batch_sizebooltrueWhether to automatically find the optimal batch size.
training.bf16booltrueWhether to use bfloat16 precision during training.
training.bf16_full_evalbooltrueWhether to use bfloat16 precision during evaluation.
training.dataloader_num_workersint8Number of worker threads for data loading.
training.dataloader_pin_memorybooltrueWhether to use pinned memory for data loading.
training.dataloader_prefetch_factorint2Number of batches to prefetch per worker.
training.ddp_find_unused_parametersboolfalseWhether to find unused parameters when using Distributed Data Parallel (DDP).
training.decode_onlyboolfalseWhether to perform decoding only, without training.
training.do_trainbooltrueWhether to perform training.
training.early_stopping_patienceint5Number of epochs with no improvement after which training will be stopped.
training.eval_delayint2Number of epochs or steps to delay evaluation.
training.eval_metrics_listlist of strings["tcp_wer", "cp_wer"]List of metrics to compute during evaluation.
training.eval_stepsint1000Number of steps between evaluations (if eval_strategy is "steps").
training.eval_strategystring"epoch"Evaluation strategy (e.g., "steps" or "epoch").
training.generation_max_lengthint225Maximum length of generated sequences during training.
training.gradient_accumulation_stepsint1Steps to accumulate gradients before updating model parameters.
training.greater_is_betterboolfalseWhether a higher metric value indicates better performance.
training.learning_ratefloat2e-6Initial learning rate.
training.load_best_model_at_endbooltrueWhether to load the best model found during training at the end.
training.logging_stepsint5Number of steps between logging outputs.
training.max_stepsint50000Maximum number of training steps.
training.metric_for_best_modelstring"eval_tcp_wer"Metric to use for selecting the best model.
training.num_train_epochsint10Number of training epochs.
training.output_dirstring$EXPERIMENT_PATH}/${experimentOutput directory for model checkpoints and logs.
training.overall_batch_sizeint64Overall batch size across all devices and gradient accumulation steps.
training.per_device_eval_batch_sizeint16Batch size per device during evaluation.
training.per_device_train_batch_sizeint1Batch size per device during training.
training.predict_with_generatebooltrueWhether to use the generate method for predictions during evaluation.
training.remove_timestamps_from_ctcboolfalseWhether to remove timestamps from CTC outputs.
training.remove_unused_columnsboolfalseWhether to remove unused columns from the dataset.
training.run_namestring${experimentName of the run (used for logging and tracking).
training.save_stepsint1000Number of steps between model saves (if save_strategy is "steps").
training.save_strategystring"epoch"Model saving strategy (e.g., "steps" or "epoch").
training.fddt_lr_multiplierfloat100.0Learning rate multiplier for FDDT parameters.
training.train_metrics_listlist of strings["tcp_wer", "cp_wer"]List of metrics to compute during training.
training.use_fddt_only_n_epochsint1Number of epochs to train only FDDT parameters.
training.use_custom_optimizerbooltrueWhether to use a custom optimizer.
training.use_t_spk_embedstring|nullnullWhether to use target speaker embeddings.
training.use_fddtbooltrueWhether to use FDDT in the model.
training.warmup_stepsint2000Number of warm-up steps for learning rate scheduler.
training.weight_decayfloat0.0Weight decay (L2 regularization) coefficient.
wandb.projectstring"chime2024_ts_asr_whisper"Name of the Weights & Biases project for logging.

Citation

If you use our model or code, please, cite:

@article{polok_dicow_2026,
	title = {{DiCoW}: {Diarization}-conditioned {Whisper} for target speaker automatic speech recognition},
	volume = {95},
	issn = {0885-2308},
	url = {https://www.sciencedirect.com/science/article/pii/S088523082500066X},
	doi = {https://doi.org/10.1016/j.csl.2025.101841},
	journal = {Computer Speech \& Language},
	author = {Polok, Alexander and Klement, Dominik and Kocour, Martin and Han, Jiangyu and Landini, Federico and Yusuf, Bolaji and Wiesner, Matthew and Khudanpur, Sanjeev and Černocký, Jan and Burget, Lukáš},
	year = {2026},
	keywords = {Diarization-conditioned Whisper, Long-form ASR, Speaker diarization, Target-speaker ASR, Whisper adaptation},
	pages = {101841},
}

Contact

For more information, feel free to contact us: ikocour@fit.vut.cz.

Contributors

MartinKocour

2 commits

BUTSpeechFIT/SOT-DiCoW

Multi-talker ASR based on DiCoW with Serialized Output Training

21

stars

2

commits

Python

primary language

Sep 18, 2025

updated

README

SOT-DiCoW

This repository contains the official implementation of SA-DiCoW (submitted to ICASSP 2026).

This repository is a fork of the previous work TS-ASR Whisper available on GitHUB.

Setup

  1. Clone the repository: git clone ...; cd ...
  2. Setup python environment (using conda or virtual environment):
  3. Install packages: pip install -r requirements.txt
  4. Change all the paths in configs/local_paths.sh (variables are explained below) based on your setup
  5. Change paths in scripts/data/prepare.sh if needed (by default, data is going to be prepared and saved to ./data) and execute it to prepare the data
  6. Run the code

Usage

Our codebase uses Hydra configuration package. All config yaml files are located in ./configs. The base configuration file with default values is configs/base.yaml (all the parameters are explained below).

To replicate the ASRU experiments, please run one of these commands:

# local node
python src/main.py +asru=sot_dicow/sot_dicow
torchrun --standalone --nnodes=1 --nproc-per-node=4 src/main.py +asru=sot_dicow/sot_dicow

# SGE
CFG="+asru=sot_dicow/sot_dicow" qsub scripts/training/submit_sge.sh

# PBS
CFG="+asru=sot_dicow/sot_dicow" qsub scripts/training/submit_pbs.sh

# SLURM
sbatch scripts/training/submit_slurm.sh +asru=sot_dicow/sot_dicow

Config Details

As you can see above, the configs are not specified via yaml file paths. Instead, Hydra uses so-called "config groups". All of our config files contain # @package _global_ on the first line, which specifies that the given values are overwriting the global default values specified in ./configs/base.yaml. If the line is not present in the config yaml file, Hydra will produce a nested object based on the relative file path.

Furthermore, none of the YAML config files contain any paths, as we strived for maximal inter-cluster/setup compatibility. Instead, Hydra package substitutes shell variables

Config Params

BASH Variables

Parameters are described in configs/local_paths.sh. Edit the values accordingly.

YAML Config Variables

ParameterTypeDefault ValueDescription
data.audio_path_prefixstring$AUDIO_PATH_PREFIXPrefix to add to audio paths.
data.audio_path_prefix_replacementstring$AUDIO_PATH_PREFIX_REPLACEMENTPrefix to replace in audio paths.
data.cache_features_for_devboolfalseWhether to cache features for the development set.
data.dataset_weightslist|nullnullWeights to assign to different datasets.
data.dev_datasetstring$NSF_DEV_DATA_PATHPath to the development dataset.
data.dev_decoding_samplesint1000Number of samples to use for decoding during development.
data.do_augmentboolfalseWhether to apply data augmentation.
data.empty_transcripts_ratiofloat0.0Ratio of training samples with empty transcripts.
data.eval_cutsetslist of strings-List of paths to evaluation cutsets.
data.eval_datasetstring$NSF_EVAL_DATA_PATHPath to the evaluation dataset.
data.eval_text_normstring"whisper_nsf"Text normalization method for evaluation data.
data.libri_dev_cached_pathstring$LIBRI_DEV_CACHED_PATHPath to cached LibriSpeech development data.
data.libri_train_cached_pathstring$LIBRI_TRAIN_CACHED_PATHPath to cached LibriSpeech training data.
data.mask_inputsboolfalseWhether to mask input data.
data.max_l_cropint0Maximum number of tokens to crop from the left.
data.max_r_cropint0Maximum number of tokens to crop from the right.
data.musan_noisesstring$MUSAN_PATHPath to the MUSAN noise dataset for data augmentation.
data.path_to_store_t_spk_embedstring|nullnullPath to store target speaker embeddings.
data.random_sentence_l_crop_pfloat0.0Probability of random left cropping of sentences.
data.random_sentence_r_crop_pfloat0.0Probability of random right cropping of sentences.
data.train_cutsetslist of strings-List of paths to training cutsets (pre-processed data segments).
data.train_text_normstring"whisper_nsf"Text normalization method for training data.
data.train_with_diar_outputsstring|nullnullWhether to train with diarization outputs.
data.use_libriboolfalseWhether to use the LibriSpeech dataset.
data.use_random_segmentationboolfalseWhether to use random segmentation of audio.
data.use_timestampsbooltrueWhether to use timestamps in the data.
data.vad_from_alignmentsboolfalseWhether to use Voice Activity Detection (VAD) from alignments.
decoding.condition_on_prevboolfalseWhether to condition on previous tokens during decoding.
decoding.decoding_ctc_weightfloat0.0Weight of CTC during decoding.
decoding.length_penaltyfloat|nullnullLength penalty applied during decoding.
experimentstring"DEFAULT_EXPERIMENT"Name of the experiment or configuration preset.
hydra.output_subdirstring|nullnullSubdirectory for Hydra outputs.
model.apply_fddt_to_n_layersint-1Number of layers to apply the FDDT to (-1 means all layers).
model.ctc_weightfloat0.3Weight of the Connectionist Temporal Classification (CTC) loss in the loss function.
model.embed_extractor_model_pathstring|nullnullPath to a model for extracting embeddings, if any.
model.prefixes_to_preheatlist of strings-List of model parameter prefixes to preheat (initialize or warm up).
model.pretrained_encoderstring|nullnullPath to a pre-trained encoder to initialize from, if any.
model.reinit_encoder_fromstring|nullnullPath to reinitialize the encoder from a specific checkpoint.
model.reinit_fromstring|nullnullPath to reinitialize the entire model from a specific checkpoint.
model.shift_pos_embedsboolfalseWhether to shift positional embeddings in the model.
model.fddt_bias_onlyboolfalseIf true, only the bias parameters are used in the FDDT.
model.fddt_initstring"disparagement"Method to initialize the FDDT parameters.
model.fddt_is_diagonalbooltrueIf set to true, the FDDT is diagonal.
model.fddt_use_non_targetbooltrueWhether to use non-target frames in the FDDT.
model.fddt_use_overlapbooltrueWhether to use overlapping frames in the FDDT.
model.fddt_use_silencebooltrueWhether to use silence frames in the FDDT.
model.fddt_use_targetbooltrueWhether to use target frames in the FDDT.
model.use_qk_biasingboolfalseWhether to use query-key biasing in the attention mechanism.
model.whisper_modelstring"openai/whisper-small.en"Name or path of the pre-trained Whisper model to use.
training.auto_find_batch_sizebooltrueWhether to automatically find the optimal batch size.
training.bf16booltrueWhether to use bfloat16 precision during training.
training.bf16_full_evalbooltrueWhether to use bfloat16 precision during evaluation.
training.dataloader_num_workersint8Number of worker threads for data loading.
training.dataloader_pin_memorybooltrueWhether to use pinned memory for data loading.
training.dataloader_prefetch_factorint2Number of batches to prefetch per worker.
training.ddp_find_unused_parametersboolfalseWhether to find unused parameters when using Distributed Data Parallel (DDP).
training.decode_onlyboolfalseWhether to perform decoding only, without training.
training.do_trainbooltrueWhether to perform training.
training.early_stopping_patienceint5Number of epochs with no improvement after which training will be stopped.
training.eval_delayint2Number of epochs or steps to delay evaluation.
training.eval_metrics_listlist of strings["tcp_wer", "cp_wer"]List of metrics to compute during evaluation.
training.eval_stepsint1000Number of steps between evaluations (if eval_strategy is "steps").
training.eval_strategystring"epoch"Evaluation strategy (e.g., "steps" or "epoch").
training.generation_max_lengthint225Maximum length of generated sequences during training.
training.gradient_accumulation_stepsint1Steps to accumulate gradients before updating model parameters.
training.greater_is_betterboolfalseWhether a higher metric value indicates better performance.
training.learning_ratefloat2e-6Initial learning rate.
training.load_best_model_at_endbooltrueWhether to load the best model found during training at the end.
training.logging_stepsint5Number of steps between logging outputs.
training.max_stepsint50000Maximum number of training steps.
training.metric_for_best_modelstring"eval_tcp_wer"Metric to use for selecting the best model.
training.num_train_epochsint10Number of training epochs.
training.output_dirstring$EXPERIMENT_PATH}/${experimentOutput directory for model checkpoints and logs.
training.overall_batch_sizeint64Overall batch size across all devices and gradient accumulation steps.
training.per_device_eval_batch_sizeint16Batch size per device during evaluation.
training.per_device_train_batch_sizeint1Batch size per device during training.
training.predict_with_generatebooltrueWhether to use the generate method for predictions during evaluation.
training.remove_timestamps_from_ctcboolfalseWhether to remove timestamps from CTC outputs.
training.remove_unused_columnsboolfalseWhether to remove unused columns from the dataset.
training.run_namestring${experimentName of the run (used for logging and tracking).
training.save_stepsint1000Number of steps between model saves (if save_strategy is "steps").
training.save_strategystring"epoch"Model saving strategy (e.g., "steps" or "epoch").
training.fddt_lr_multiplierfloat100.0Learning rate multiplier for FDDT parameters.
training.train_metrics_listlist of strings["tcp_wer", "cp_wer"]List of metrics to compute during training.
training.use_fddt_only_n_epochsint1Number of epochs to train only FDDT parameters.
training.use_custom_optimizerbooltrueWhether to use a custom optimizer.
training.use_t_spk_embedstring|nullnullWhether to use target speaker embeddings.
training.use_fddtbooltrueWhether to use FDDT in the model.
training.warmup_stepsint2000Number of warm-up steps for learning rate scheduler.
training.weight_decayfloat0.0Weight decay (L2 regularization) coefficient.
wandb.projectstring"chime2024_ts_asr_whisper"Name of the Weights & Biases project for logging.

Citation

If you use our model or code, please, cite:

@article{polok_dicow_2026,
	title = {{DiCoW}: {Diarization}-conditioned {Whisper} for target speaker automatic speech recognition},
	volume = {95},
	issn = {0885-2308},
	url = {https://www.sciencedirect.com/science/article/pii/S088523082500066X},
	doi = {https://doi.org/10.1016/j.csl.2025.101841},
	journal = {Computer Speech \& Language},
	author = {Polok, Alexander and Klement, Dominik and Kocour, Martin and Han, Jiangyu and Landini, Federico and Yusuf, Bolaji and Wiesner, Matthew and Khudanpur, Sanjeev and Černocký, Jan and Burget, Lukáš},
	year = {2026},
	keywords = {Diarization-conditioned Whisper, Long-form ASR, Speaker diarization, Target-speaker ASR, Whisper adaptation},
	pages = {101841},
}

Contact

For more information, feel free to contact us: ikocour@fit.vut.cz.

Contributors

MartinKocour

2 commits

Languages

Python

94.0%

Shell

6.0%