nemo_curator.stages.audio.postprocessing.timestamp_mapper
nemo_curator.stages.audio.postprocessing.timestamp_mapper
Timestamp mapper stage.
Normalizes task data at the pipeline output boundary. Handles four sources of timing information (checked in priority order):
segment_mappingsintask._metadata— remaps concat-space positions back to original file positions.start_ms/end_msintask.data— uses them directly as original positions (from VAD fan-out).diar_segmentsintask.data— computes span from first segment start to last segment end (from SpeakerSep).durationfallback — uses whole-file duration.
Output control uses two layers:
- passthrough_keys (whitelist): only keys in this list are copied from the input to the output. Defaults to all built-in quality filter and speaker metadata keys. Users can override via config.
- _NEVER_PASS_KEYS (safety net): non-serializable keys that are
always blocked, even if accidentally added to
passthrough_keys.
Module Contents
Classes
Functions
Data
API
Bases: ProcessingStage[AudioTask, AudioTask]
Normalize task data at the pipeline output boundary.
Constructs core output fields from available timing sources,
then copies only the keys listed in passthrough_keys from
the input.
Core fields (always present, not controlled by passthrough_keys):
original_file, original_start_ms, original_end_ms,
duration_ms, duration.
When diarization segments are available: diar_segments,
speaking_duration are also set as core fields.
Parameters:
Keys to copy from input to output. Defaults to all built-in quality filter and speaker metadata keys. Override to include custom fields or restrict the output schema.
Translate concatenated position range to original file positions.