Skip to content

Commit 043a731

Browse files
author
Zenflow
committed
step2: suppress false drift warnings for pre-anchor intro segments
The drift check now starts at anchor_si instead of segment 0. Segments before the anchor lie in the podcast intro jingle where Whisper produces no words — that is expected behaviour, not drift. Also changed 'FEHLER' to 'WARNUNG' in the message text since a missing w1 word near an expected timestamp is a warning, not a hard error.
1 parent ab2522f commit 043a731

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

scripts/podcast_to_moshi_dataset.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -400,24 +400,24 @@ def try_match_seg(seg: dict, w1_pos: int) -> tuple | None:
400400
f"anchor_offset={anchor_offset:+.3f}s", flush=True)
401401

402402
# ── Segment-Dauer-Selbstprüfung (linearer Offset) ─────────────────────────
403-
# Für jedes lange Segment: Prüfe ob nahe am erwarteten w1-Zeitpunkt
404-
# tatsächlich Inhalt vorhanden ist. Warnung wenn Drift > DRIFT_WARN_S.
403+
# Nur Segmente NACH dem Anchor prüfen — Segmente davor liegen im Intro-Jingle,
404+
# wo Whisper erwartungsgemäß still ist. Das ist kein Drift.
405405
DRIFT_WARN_S = 5.0 # Warnschwelle für Timestamp-Drift
406406
n_warn = 0
407-
for si, seg in enumerate(transcript_segs[:50]): # Erste 50 für schnellen Überblick
407+
for si, seg in enumerate(transcript_segs[anchor_si:50], start=anchor_si):
408408
if len(seg_words(seg)) < MIN_SEG_WORDS:
409409
continue
410410
expected_w1 = float(seg["start"]) + anchor_offset
411411
# Prüfe ob in ±DRIFT_WARN_S ein w1-Wort liegt
412412
lo = bisect.bisect_left(w1_starts, expected_w1 - DRIFT_WARN_S)
413413
hi = bisect.bisect_right(w1_starts, expected_w1 + DRIFT_WARN_S)
414414
if hi <= lo:
415-
print(f" step2: FEHLER Segment {si} — "
415+
print(f" step2: WARNUNG Segment {si} — "
416416
f"erwartet w1-Zeit {expected_w1:.2f}s, "
417417
f"aber kein w1-Wort in ±{DRIFT_WARN_S:.0f}s-Fenster", flush=True)
418418
n_warn += 1
419419
if n_warn:
420-
print(f" step2: {n_warn} Drift-Warnungen in den ersten 50 Segmenten", flush=True)
420+
print(f" step2: {n_warn} Drift-Warnungen nach dem Anchor (erste 50 Segmente)", flush=True)
421421

422422
# ── Linearer Offset → Zeitstempel für alle w0-Wörter ─────────────────────
423423
# Jedes w0-Wort erhält: start = w0_seg.start + anchor_offset (linear)

0 commit comments

Comments
 (0)