Repository navigation
docs: rename AudioBatch to AudioTask in audio curation docs #1694
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
86bebb2
61bb185
a7ea2af
9a2f327
6164494
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,7 +18,7 @@ The ASR pipeline in NeMo Curator follows a systematic approach to speech process | |
|
|
||
| ```mermaid | ||
| graph TD | ||
| A[Audio Files] --> B[AudioBatch Creation] | ||
| A[Audio Files] --> B[AudioTask Creation] | ||
| B --> C[ASR Model Loading] | ||
| C --> D[Batch Inference] | ||
| D --> E[Transcription Output] | ||
|
|
@@ -46,15 +46,15 @@ graph TD | |
|
|
||
| ### 1. Audio Input Management | ||
|
|
||
| **AudioBatch Structure**: The foundation for audio processing | ||
| **AudioTask Structure**: The foundation for audio processing | ||
|
|
||
| - Contains audio file paths and associated metadata | ||
| - Validates file existence and accessibility automatically | ||
| - Supports efficient batch processing for scalability | ||
|
|
||
| **Input Validation**: Ensures data integrity before processing | ||
|
|
||
| - File path existence checks using `AudioBatch.validate()` and `validate_item()` | ||
| - File path existence checks using `AudioTask.validate()` and `validate_item()` | ||
| - Optional metadata validation added by downstream stages (such as duration and format checks) | ||
|
|
||
| ### 2. ASR Model Integration | ||
|
|
@@ -104,7 +104,7 @@ manifest_reader = JsonlReader( | |
| input_file_path="/path/to/manifest.jsonl" | ||
| ) | ||
|
|
||
| # Stages automatically create AudioBatch objects from loaded data | ||
| # Stages automatically create AudioTask objects from loaded data | ||
| ``` | ||
|
|
||
| ### Stage 2: ASR Model Setup | ||
|
|
@@ -125,11 +125,11 @@ asr_stage.setup() # Downloads and loads model | |
| ### Stage 3: Transcription Generation | ||
|
|
||
| ```python | ||
| # ASR stage processes AudioBatch objects automatically | ||
| # ASR stage processes AudioTask objects automatically | ||
| # The stage extracts file paths and calls transcribe() internally | ||
| processed_batch = asr_stage.process(audio_batch) | ||
| processed_batch = asr_stage.process(audio_task) | ||
|
|
||
| # Output: AudioBatch with added "pred_text" field | ||
| # Output: AudioTask with added "pred_text" field | ||
| # Each item now contains both original data and predictions | ||
| ``` | ||
|
|
||
|
|
@@ -156,7 +156,7 @@ duration_stage = GetAudioDurationStage( | |
|
|
||
| 1. **Audio Files** → File system | ||
| 2. **Manifest Files** → JSONL format with metadata | ||
| 3. **AudioBatch Objects** → Validated, structured data containers | ||
| 3. **AudioTask Objects** → Validated, structured data containers | ||
|
|
||
| ### Processing Data Flow | ||
|
|
||
|
|
@@ -217,10 +217,10 @@ asr_stage = InferenceAsrNemoStage( | |
|
|
||
| ```python | ||
| # Validate and filter invalid file paths | ||
| audio_batch = AudioBatch(data=audio_data, filepath_key="audio_filepath") | ||
| audio_task = AudioTask(data=audio_data, filepath_key="audio_filepath") | ||
|
|
||
| # Filter out entries that do not exist on disk | ||
| valid_samples = [item for item in audio_batch.data if audio_batch.validate_item(item)] | ||
| valid_samples = [item for item in audio_task.data if audio_task.validate_item(item)] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Since
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. audio_task.data is a dict (specifically _AttrDict). Iterating over a dict yields its keys — strings like "audio_filepath", "text", "duration" — not manifest entries. This is holdover from AudioBatch.data which was list[dict]. The comprehension would produce something like ["audio_filepath", "text"] (keys that happen to pass validate_item), which is nonsensical. Since AudioTask is single-entry, validation is simply: is_valid = audio_task.validate() |
||
| ``` | ||
|
|
||
| ### Pipeline Recovery | ||
|
|
@@ -237,7 +237,7 @@ The ASR pipeline seamlessly integrates with text processing workflows: | |
| # Audio → Text pipeline | ||
| audio_to_text = [ | ||
| InferenceAsrNemoStage(), # Audio → Transcriptions | ||
| AudioToDocumentStage(), # AudioBatch → DocumentBatch | ||
| AudioToDocumentStage(), # AudioTask → DocumentBatch | ||
| # Continue with text processing stages... | ||
| ] | ||
| ``` | ||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
InferenceAsrNemoStage.process() raises NotImplementedError.
Users should never call process() directly on ASR stages — the pipeline executor handles dispatch via process_batch().
Fix — either show process_batch() directly:
results = asr_stage.process_batch([audio_task])
Or (better) show the executor-driven pattern:
Don't call process() directly — the Pipeline/Executor handles dispatch:
pipeline.add_stage(asr_stage)
results = pipeline.run(executor)