nemo_curator.stages.audio.filtering.band

View as Markdown

Band filter stage for audio bandwidth classification.

Classifies audio as “full_band” or “narrow_band” based on spectral characteristics. Useful for filtering low-quality telephone or compressed audio.

Module Contents

Classes

NameDescription
BandFilterStageBand filter stage for bandwidth classification.

Data

_HF_MODEL_FILENAME

_HF_REPO_ID

API

class nemo_curator.stages.audio.filtering.band.BandFilterStage(
model_path: str | None = None,
cache_dir: str | None = None,
band_value: typing.Literal['full_band', 'narrow_band'] = 'full_band',
name: str = 'BandFilter',
batch_size: int = 1,
resources: nemo_curator.stages.resources.Resources = (lambda: Resources(cpus=4.0...
)
Dataclass

Bases: ProcessingStage[AudioTask, AudioTask]

Band filter stage for bandwidth classification.

Classifies audio as “full_band” or “narrow_band” and filters based on the specified band_value to pass.

Parameters:

model_path
str | NoneDefaults to None

Local path to band classifier model (.joblib). If not provided, the model is downloaded from HuggingFace (nvidia/nemocurator-speech-bandwidth-filter).

cache_dir
str | NoneDefaults to None

Directory to cache downloaded models.

band_value
Literal['full_band', 'narrow_band']Defaults to 'full_band'

Which band type to pass (“full_band” or “narrow_band”)

_VALID_BAND_VALUES
set[str] = {'full_band', 'narrow_band'}
band_value
Literal['full_band', 'narrow_band'] = 'full_band'
batch_size
int = 1
cache_dir
str | None = None
model_path
str | None = None
name
str = 'BandFilter'
resources
Resources
nemo_curator.stages.audio.filtering.band.BandFilterStage.__post_init__()
nemo_curator.stages.audio.filtering.band.BandFilterStage._initialize_predictor() -> None
nemo_curator.stages.audio.filtering.band.BandFilterStage._process_single(
task: nemo_curator.tasks.AudioTask
) -> nemo_curator.tasks.AudioTask | None

Run band classification on a single (non-nested) task.

nemo_curator.stages.audio.filtering.band.BandFilterStage._resolve_model_path() -> str
nemo_curator.stages.audio.filtering.band.BandFilterStage.inputs() -> tuple[list[str], list[str]]
nemo_curator.stages.audio.filtering.band.BandFilterStage.outputs() -> tuple[list[str], list[str]]
nemo_curator.stages.audio.filtering.band.BandFilterStage.process(
task: nemo_curator.tasks.AudioTask
) -> nemo_curator.tasks.AudioTask | list[nemo_curator.tasks.AudioTask]

Filter audio based on bandwidth classification.

When task.data contains a "segments" key (nested mode from VAD), each segment is evaluated individually and only survivors are kept.

Returns: AudioTask | list[AudioTask]

AudioTask if passes the band filter, [] if filtered out.

nemo_curator.stages.audio.filtering.band.BandFilterStage.setup(
_: nemo_curator.backends.base.WorkerMetadata | None = None
) -> None
nemo_curator.stages.audio.filtering.band.BandFilterStage.setup_on_node(
_node_info: nemo_curator.backends.base.NodeInfo | None = None,
_worker_metadata: nemo_curator.backends.base.WorkerMetadata | None = None
) -> None
nemo_curator.stages.audio.filtering.band.BandFilterStage.teardown() -> None
nemo_curator.stages.audio.filtering.band._HF_MODEL_FILENAME = 'band_classifier_model_band_7000_samples.joblib'
nemo_curator.stages.audio.filtering.band._HF_REPO_ID = 'nvidia/nemocurator-speech-bandwidth-filter'