ManuBo commited on
Commit
d29e2f6
·
1 Parent(s): 17ab76a
Files changed (6) hide show
  1. .DS_Store +0 -0
  2. .gitignore +1 -0
  3. hf_space/README.md +60 -9
  4. hf_space/app.py +125 -66
  5. hf_space/blog +1 -0
  6. hf_space/requirements.txt +1 -2
.DS_Store CHANGED
Binary files a/.DS_Store and b/.DS_Store differ
 
.gitignore CHANGED
@@ -7,3 +7,4 @@ build/
7
  *.wav
8
  demo/sample_data/
9
  .eggs/
 
 
7
  *.wav
8
  demo/sample_data/
9
  .eggs/
10
+ hf_space/blog/
hf_space/README.md CHANGED
@@ -1,22 +1,73 @@
1
  ---
2
  title: Audio Data Quality Toolkit
3
- emoji: 🔊
4
  colorFrom: blue
5
- colorTo: green
6
  sdk: gradio
7
- sdk_version: "4.44.1"
8
  app_file: app.py
9
- pinned: false
10
- license: mit
11
- short_description: Lint audio datasets for TTS/ASR. 13 checks.
12
  tags:
13
  - audio
14
- - quality
15
- - tts
16
  - speech
17
- - dataset
 
 
 
 
 
 
 
18
  ---
19
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  # Audio Data Quality Toolkit
21
 
22
  Upload audio files and get instant quality reports. 13 automated checks, zero GPU.
 
1
  ---
2
  title: Audio Data Quality Toolkit
3
+ emoji: 🎙️
4
  colorFrom: blue
5
+ colorTo: purple
6
  sdk: gradio
7
+ sdk_version: "5.29.0"
8
  app_file: app.py
9
+ pinned: true
 
 
10
  tags:
11
  - audio
 
 
12
  - speech
13
+ - tts
14
+ - asr
15
+ - synthetic-data
16
+ - data-quality
17
+ - evaluation
18
+ - gradio
19
+ - machine-learning
20
+ short_description: QA dashboard for TTS/ASR audio datasets
21
  ---
22
 
23
+ # 🎙️ Audio Data Quality Toolkit for TTS/ASR Training Pipelines
24
+
25
+ A lightweight quality-control dashboard for speech datasets used in **text-to-speech**, **automatic speech recognition**, **voice cloning**, and **synthetic speech evaluation**.
26
+
27
+ The toolkit helps detect common data issues that degrade speech model training:
28
+
29
+ - clipping and distorted audio
30
+ - long silence or empty clips
31
+ - noisy samples
32
+ - duplicate or near-duplicate clips
33
+ - transcript/audio mismatch
34
+ - speaker imbalance
35
+ - abnormal duration and speech-rate patterns
36
+ - possible synthetic-data artifacts
37
+
38
+ ## Why this matters
39
+
40
+ TTS and ASR models are highly sensitive to training-data quality. Low-quality clips can cause unstable alignment, bad pronunciation, poor speaker consistency, hallucinated words, and degraded long-form generation.
41
+
42
+ This Space is designed as a practical inspection tool for researchers and ML engineers building speech datasets and synthetic audio pipelines.
43
+
44
+ ## Current features
45
+
46
+ - Upload one or multiple audio files
47
+ - Compute duration, RMS energy, peak amplitude, silence ratio, and clipping ratio
48
+ - Flag potentially problematic clips
49
+ - Display waveform-level diagnostics
50
+ - Export a quality report
51
+ - Provide dataset-level summary statistics
52
+
53
+ ## Intended use cases
54
+
55
+ - TTS dataset cleaning
56
+ - ASR dataset validation
57
+ - Synthetic speech evaluation
58
+ - Voice-cloning dataset inspection
59
+ - Audio preprocessing QA
60
+ - ML data pipeline debugging
61
+
62
+ ## Roadmap
63
+
64
+ - Transcript mismatch detection using ASR
65
+ - Speaker imbalance estimation
66
+ - Duplicate detection with audio embeddings
67
+ - Synthetic artifact scoring
68
+ - Batch dataset reports
69
+ - Hugging Face dataset integration
70
+
71
  # Audio Data Quality Toolkit
72
 
73
  Upload audio files and get instant quality reports. 13 automated checks, zero GPU.
hf_space/app.py CHANGED
@@ -163,107 +163,166 @@ def analyze_batch(files, expected_sr, min_dur, max_dur, snr_thresh):
163
  return "\n".join(lines)
164
 
165
 
 
 
 
 
 
 
 
 
 
166
  with gr.Blocks(title="Audio Data Quality Toolkit", theme=gr.themes.Soft()) as demo:
 
 
167
  gr.Markdown("""
168
- # Audio Data Quality Toolkit
169
  **Lint your audio datasets before training.** 13 automated checks for TTS, ASR, and voice-cloning pipelines.
170
 
171
  No GPU required. All checks run on CPU with numpy/scipy/librosa.
172
 
173
- Unlike perceptual scoring tools (NISQA, PESQ, UTMOS) that answer *"how good does this sound?"*,
174
- this toolkit answers *"is this file ready for training?"* -- catching the data engineering issues
175
- that silently degrade model quality.
176
  """)
177
 
178
- with gr.Tab("Single File"):
179
- with gr.Row():
180
- with gr.Column(scale=2):
181
- audio_input = gr.Audio(type="filepath", label="Upload Audio")
182
- transcript_input = gr.Textbox(
183
- label="Transcript (optional)",
184
- placeholder="If provided, checks chars-per-second alignment",
185
- lines=2,
186
- )
187
- with gr.Column(scale=1):
188
- sr_choice = gr.Dropdown(
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
189
  choices=["Auto", "16000", "22050", "24000", "44100", "48000"],
190
- value="Auto", label="Expected Sample Rate",
191
  )
192
- min_dur = gr.Number(value=0.5, label="Min Duration (s)")
193
- max_dur = gr.Number(value=30.0, label="Max Duration (s)")
194
- snr_thresh = gr.Number(value=20.0, label="SNR Threshold (dB)")
195
-
196
- analyze_btn = gr.Button("Run Quality Checks", variant="primary")
197
- result_md = gr.Markdown(label="Results")
198
- result_json = gr.Code(label="Full JSON", language="json")
199
-
200
- analyze_btn.click(
201
- analyze_single,
202
- inputs=[audio_input, transcript_input, sr_choice, min_dur, max_dur, snr_thresh],
203
- outputs=[result_md, result_json],
204
- )
205
 
206
- with gr.Tab("Batch (Directory)"):
207
- gr.Markdown("Upload multiple audio files for batch analysis.")
208
- batch_input = gr.File(
209
- file_count="multiple",
210
- file_types=["audio"],
211
- label="Upload Audio Files",
212
- )
213
- with gr.Row():
214
- b_sr = gr.Dropdown(
215
- choices=["Auto", "16000", "22050", "24000", "44100", "48000"],
216
- value="Auto", label="Expected SR",
217
  )
218
- b_min = gr.Number(value=0.5, label="Min Duration (s)")
219
- b_max = gr.Number(value=30.0, label="Max Duration (s)")
220
- b_snr = gr.Number(value=20.0, label="SNR Threshold")
221
 
222
- batch_btn = gr.Button("Run Batch Analysis", variant="primary")
223
- batch_result = gr.Markdown(label="Batch Results")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
224
 
225
- batch_btn.click(
226
- analyze_batch,
227
- inputs=[batch_input, b_sr, b_min, b_max, b_snr],
228
- outputs=[batch_result],
229
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
230
 
231
- with gr.Tab("What It Checks"):
232
- gr.Markdown("""
233
  | # | Check | What It Catches | GPU? |
234
  |---|-------|----------------|------|
235
  | 1 | SNR Estimation | Background noise, hum, hiss | No |
236
  | 2 | Clipping Detection | Consecutive samples at max amplitude | No |
237
  | 3 | Silence Analysis | Excessive leading, trailing, or internal silence | No |
238
  | 4 | Sample Rate Validation | Non-standard or unexpected rates | No |
239
- | 5 | Duration Bounds | Too short (<0.5s) or too long (>30s) | No |
240
  | 6 | Loudness (LUFS) | Audio far from target loudness | No |
241
  | 7 | Metallic Artifacts | Robotic/metallic TTS artifacts | No |
242
  | 8 | Repetition Detection | Word/phrase loops via autocorrelation | No |
243
  | 9 | Channel Issues | Stereo, silent channels, phase inversion | No |
244
- | 10 | Upsampling Detection | Fake sample rates (8kHz upsampled to 22kHz) | No |
245
- | 11 | Transcript Ratio | Misaligned transcripts (chars-per-second) | No |
246
  | 12 | Duplicate Detection | Near-duplicate files via fingerprinting | No |
247
- | 13 | Transcript Alignment | Audio vs text mismatch (optional Whisper) | Optional |
248
 
249
- ### How is this different from NISQA / PESQ / DataSpeech?
250
 
251
  | Tool | What it does | GPU | Output |
252
  |------|-------------|-----|--------|
253
- | **NISQA** | Perceptual MOS score (1-5) | Yes | Quality score |
254
  | **PESQ** | Reference-based quality score | No | Quality score |
255
- | **DataSpeech** | Annotate datasets for Parler-TTS training | Yes | NL descriptions |
256
  | **This toolkit** | Pass/fail lint for training readiness | No | Report + clean manifest |
257
 
258
- DataSpeech answers "describe this audio's characteristics for TTS conditioning."
259
- This toolkit answers "should I include this file in my training set at all?"
260
- """)
261
 
262
- gr.Markdown("""
263
  ---
264
- **Install:** `pip install audio-data-quality-toolkit`
265
- | [GitHub](https://github.com/EmmanuelleB985/audio-data-quality-toolkit)
266
- | **Python API:** `from audio_qa import check_file, check_directory, audit_hf_dataset`
267
  """)
268
 
269
 
 
163
  return "\n".join(lines)
164
 
165
 
166
+ TITLE = "🎙️ Audio Data Quality Toolkit for TTS/ASR Training Pipelines"
167
+
168
+ DESCRIPTION = """
169
+ Detect clipping, silence, noisy samples, duplicate clips, transcript mismatch,
170
+ speaker imbalance, and synthetic-data artifacts in speech datasets.
171
+
172
+ Designed for TTS, ASR, voice-cloning, and synthetic speech evaluation workflows.
173
+ """
174
+
175
  with gr.Blocks(title="Audio Data Quality Toolkit", theme=gr.themes.Soft()) as demo:
176
+ gr.Markdown(f"# {TITLE}")
177
+ gr.Markdown(DESCRIPTION)
178
  gr.Markdown("""
 
179
  **Lint your audio datasets before training.** 13 automated checks for TTS, ASR, and voice-cloning pipelines.
180
 
181
  No GPU required. All checks run on CPU with numpy/scipy/librosa.
182
 
183
+ Unlike perceptual scoring tools such as NISQA, PESQ, or UTMOS, which answer *"how good does this sound?"*,
184
+ this toolkit answers *"is this file ready for training?"* by catching the data-engineering issues that silently degrade model quality.
 
185
  """)
186
 
187
+ with gr.Tabs():
188
+ with gr.Tab("Single clip analysis"):
189
+ gr.Markdown("Upload one audio clip and inspect training-readiness quality signals.")
190
+ with gr.Row():
191
+ with gr.Column(scale=2):
192
+ audio_input = gr.Audio(type="filepath", label="Upload audio clip")
193
+ transcript_input = gr.Textbox(
194
+ label="Optional transcript",
195
+ placeholder="Paste the expected transcript here to check chars-per-second alignment...",
196
+ lines=2,
197
+ )
198
+ with gr.Column(scale=1):
199
+ sr_choice = gr.Dropdown(
200
+ choices=["Auto", "16000", "22050", "24000", "44100", "48000"],
201
+ value="Auto", label="Expected sample rate",
202
+ )
203
+ min_dur = gr.Number(value=0.5, label="Min duration (s)")
204
+ max_dur = gr.Number(value=30.0, label="Max duration (s)")
205
+ snr_thresh = gr.Number(value=20.0, label="SNR threshold (dB)")
206
+
207
+ analyze_btn = gr.Button("Analyze audio quality", variant="primary")
208
+ result_md = gr.Markdown(label="Quality report")
209
+ result_json = gr.Code(label="Full JSON", language="json")
210
+
211
+ analyze_btn.click(
212
+ analyze_single,
213
+ inputs=[audio_input, transcript_input, sr_choice, min_dur, max_dur, snr_thresh],
214
+ outputs=[result_md, result_json],
215
+ )
216
+
217
+ with gr.Tab("Batch dataset audit"):
218
+ gr.Markdown(
219
+ "Upload multiple clips to generate a dataset-level QA report for TTS, ASR, voice-cloning, or synthetic speech pipelines."
220
+ )
221
+ batch_input = gr.File(
222
+ file_count="multiple",
223
+ file_types=["audio"],
224
+ label="Upload audio files",
225
+ )
226
+ with gr.Row():
227
+ b_sr = gr.Dropdown(
228
  choices=["Auto", "16000", "22050", "24000", "44100", "48000"],
229
+ value="Auto", label="Expected sample rate",
230
  )
231
+ b_min = gr.Number(value=0.5, label="Min duration (s)")
232
+ b_max = gr.Number(value=30.0, label="Max duration (s)")
233
+ b_snr = gr.Number(value=20.0, label="SNR threshold (dB)")
 
 
 
 
 
 
 
 
 
 
234
 
235
+ batch_btn = gr.Button("Run batch audit", variant="primary")
236
+ batch_result = gr.Markdown(label="Dataset quality report")
237
+
238
+ batch_btn.click(
239
+ analyze_batch,
240
+ inputs=[batch_input, b_sr, b_min, b_max, b_snr],
241
+ outputs=[batch_result],
 
 
 
 
242
  )
 
 
 
243
 
244
+ with gr.Tab("Synthetic speech evaluation"):
245
+ gr.Markdown(
246
+ "Evaluate generated speech samples for clipping, silence, noise, duration anomalies, and transcript consistency."
247
+ )
248
+ with gr.Row():
249
+ with gr.Column(scale=2):
250
+ synthetic_audio = gr.Audio(type="filepath", label="Generated speech sample")
251
+ expected_text = gr.Textbox(
252
+ label="Expected text",
253
+ placeholder="Paste the prompt/text that the TTS system was supposed to speak...",
254
+ lines=3,
255
+ )
256
+ with gr.Column(scale=1):
257
+ synth_sr = gr.Dropdown(
258
+ choices=["Auto", "16000", "22050", "24000", "44100", "48000"],
259
+ value="Auto", label="Expected sample rate",
260
+ )
261
+ synth_min = gr.Number(value=0.5, label="Min duration (s)")
262
+ synth_max = gr.Number(value=60.0, label="Max duration (s)")
263
+ synth_snr = gr.Number(value=20.0, label="SNR threshold (dB)")
264
+
265
+ synth_button = gr.Button("Evaluate synthetic sample", variant="primary")
266
+ synth_output = gr.Markdown(label="Synthetic speech QA")
267
+ synth_json = gr.Code(label="Full JSON", language="json")
268
+
269
+ synth_button.click(
270
+ analyze_single,
271
+ inputs=[synthetic_audio, expected_text, synth_sr, synth_min, synth_max, synth_snr],
272
+ outputs=[synth_output, synth_json],
273
+ )
274
 
275
+ with gr.Tab("About"):
276
+ gr.Markdown("""
277
+ ## What this tool checks
278
+
279
+ - **Clipping:** waveform peaks too close to maximum amplitude
280
+ - **Silence:** long leading, trailing, or internal silent regions
281
+ - **Noise:** low signal quality, background hum, hiss, or abnormal energy profile
282
+ - **Transcript mismatch:** audio duration may not match the expected text length
283
+ - **Speaker imbalance:** some speakers may dominate the dataset *(roadmap / metadata-dependent)*
284
+ - **Duplicates:** repeated or near-identical clips *(roadmap / fingerprinting-dependent)*
285
+ - **Synthetic artifacts:** robotic, metallic, repeated, or degraded generated speech patterns
286
+
287
+ ## Why this matters
288
+
289
+ Data quality directly affects TTS/ASR model stability, pronunciation, speaker consistency, alignment, and long-form generation quality.
290
+ This Space is designed as a practical QA dashboard for speech datasets used in training and evaluating voice AI systems.
291
+
292
+ ## Current checks
293
 
 
 
294
  | # | Check | What It Catches | GPU? |
295
  |---|-------|----------------|------|
296
  | 1 | SNR Estimation | Background noise, hum, hiss | No |
297
  | 2 | Clipping Detection | Consecutive samples at max amplitude | No |
298
  | 3 | Silence Analysis | Excessive leading, trailing, or internal silence | No |
299
  | 4 | Sample Rate Validation | Non-standard or unexpected rates | No |
300
+ | 5 | Duration Bounds | Too short or too long clips | No |
301
  | 6 | Loudness (LUFS) | Audio far from target loudness | No |
302
  | 7 | Metallic Artifacts | Robotic/metallic TTS artifacts | No |
303
  | 8 | Repetition Detection | Word/phrase loops via autocorrelation | No |
304
  | 9 | Channel Issues | Stereo, silent channels, phase inversion | No |
305
+ | 10 | Upsampling Detection | Fake sample rates, e.g. 8kHz upsampled to 22kHz | No |
306
+ | 11 | Transcript Ratio | Misaligned transcripts using chars-per-second | No |
307
  | 12 | Duplicate Detection | Near-duplicate files via fingerprinting | No |
308
+ | 13 | Transcript Alignment | Audio vs text mismatch with optional ASR | Optional |
309
 
310
+ ## How is this different from NISQA / PESQ / DataSpeech?
311
 
312
  | Tool | What it does | GPU | Output |
313
  |------|-------------|-----|--------|
314
+ | **NISQA** | Perceptual MOS score | Yes | Quality score |
315
  | **PESQ** | Reference-based quality score | No | Quality score |
316
+ | **DataSpeech** | Annotate datasets for Parler-TTS training | Yes | Natural-language descriptions |
317
  | **This toolkit** | Pass/fail lint for training readiness | No | Report + clean manifest |
318
 
319
+ DataSpeech answers: *"describe this audio's characteristics for TTS conditioning."*
320
+ This toolkit answers: *"should I include this file in my training set at all?"*
 
321
 
 
322
  ---
323
+ **Install:** `pip install audio-data-quality-toolkit`
324
+ [GitHub](https://github.com/EmmanuelleB985/audio-data-quality-toolkit)
325
+ **Python API:** `from audio_qa import check_file, check_directory, audit_hf_dataset`
326
  """)
327
 
328
 
hf_space/blog ADDED
@@ -0,0 +1 @@
 
 
1
+ Subproject commit 268cabd6e1d78be29aa67a4bdb52e5b4b5ec292b
hf_space/requirements.txt CHANGED
@@ -1,5 +1,4 @@
1
  numpy>=1.22
2
  scipy>=1.8
3
  soundfile>=0.12
4
- librosa>=0.9
5
- gradio>=4.0
 
1
  numpy>=1.22
2
  scipy>=1.8
3
  soundfile>=0.12
4
+ librosa>=0.9