Implementation:Speechbrain Speechbrain Prepare AMI Diarization
| Knowledge Sources | |
|---|---|
| Domains | Speaker Diarization, Data Preparation |
| Last Updated | 2026-02-09 00:00 GMT |
Overview
Concrete tool for preparing AMI corpus data for speaker diarization provided by the SpeechBrain library.
Description
This script prepares metadata files (JSON) and reference RTTM files from the AMI Meeting Corpus manual annotations for speaker diarization tasks. It processes XML-based segment annotations into RTTM format (Oracle VAD), splits the data according to standard AMI corpus splits (scenario_only, full_corpus, or full_corpus_asr), and generates sub-segments with configurable duration and overlap for diarization model training and evaluation.
Usage
Use this when preparing the AMI Meeting Corpus dataset for speaker diarization training with SpeechBrain recipes.
Code Reference
Source Location
- Repository: SpeechBrain
- File: recipes/AMI/Diarization/ami_prepare.py
Signature
def prepare_ami(
data_folder,
manual_annot_folder,
save_folder,
ref_rttm_dir,
meta_data_dir,
split_type="full_corpus_asr",
skip_TNO=True,
mic_type="Lapel",
vad_type="oracle",
max_subseg_dur=3.0,
overlap=1.5,
):
Import
from ami_prepare import prepare_ami
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| data_folder | str | Yes | Path to the folder where the original AMI corpus is stored |
| manual_annot_folder | str | Yes | Directory where the manual annotations are stored |
| save_folder | str | Yes | The save directory in results |
| ref_rttm_dir | str | Yes | Directory to store reference RTTM files |
| meta_data_dir | str | Yes | Directory to store the metadata (JSON) files |
| split_type | str | No | Standard dataset split: "scenario_only", "full_corpus", or "full_corpus_asr" (default: "full_corpus_asr") |
| skip_TNO | bool | No | Skips TNO meeting recordings if True (default: True) |
| mic_type | str | No | Type of microphone to be used (default: "Lapel") |
| vad_type | str | No | Type of VAD (default: "oracle") |
| max_subseg_dur | float | No | Maximum sub-segment duration in seconds (default: 3.0) |
| overlap | float | No | Overlap between sub-segments in seconds (default: 1.5) |
Outputs
| Name | Type | Description |
|---|---|---|
| RTTM files | RTTM Files | Reference RTTM files for train/dev/test splits |
| JSON metadata | JSON Files | Prepared metadata manifest files for train/dev/test splits |
Usage Examples
from ami_prepare import prepare_ami
prepare_ami(
data_folder="/path/to/amicorpus",
manual_annot_folder="/path/to/ami_manual_annotations",
save_folder="/path/to/output",
ref_rttm_dir="/path/to/output/ref_rttms",
meta_data_dir="/path/to/output/metadata",
split_type="full_corpus_asr",
mic_type="Lapel",
max_subseg_dur=3.0,
overlap=1.5,
)