Skip to content

A demo for forced alignment - #61

Merged
sw005320 merged 2 commits into
masterfrom
demos/align
Sep 22, 2026
Merged

sw005320 merged 2 commits into
masterfrom
demos/align

Conversation

@sw005320

Copy link
Copy Markdown
Contributor

The support matrix going into espnet's README (espnet#6778) has two rows with holes in them; alignment is one, and this fills its notebook column.

ForcedAligner on espnet/owsm_ctc_v4_1B, on CPU, in six steps:

  • four utterances and a recording, with no times given
  • where each utterance falls, and how sure the model is
  • the time and probability of every token inside one of them — where a word-level timestamp comes from
  • the waveform with the boundaries drawn on it
  • what the score is for: one caption swapped for something that was not said scores 0.000 beside three that score 0.99. That is alignment-score filtering, which is how OWSM v4 cleaned its training data
  • write the text the way the model writes it

The last one is a trap the notebook found by being run, and it is worth naming here. This recording's own reference transcript is in capitals:

The sale of the hotels                   0.990
THE SALE OF THE HOTELS                   0.000

OWSM's vocabulary has no capitalised words, so each breaks into letters — ▁T H E ▁ SA L …, 79 tokens for the four lines instead of 24 — and the mean probability collapses while the boundaries stay roughly right. A reader who starts from the reference transcript would conclude the aligner is broken. The notebook shows it, and espnet#6790 puts it in Segment.score's docstring.

Name. s2t_align_demo.ipynb, not align_demo.ipynb: Demos/README.md states <task>_<variant>_demo.ipynb with <task> one of the ESPnet task names, and tools/check_layout.py fails otherwise. Alignment is a variant of s2t here rather than a task of its own.

Verified with tools/run_notebook.py, against espnet master: RESULT ok, 16 cells.

CI will be red until the release ships. The notebook pins espnet==202610.post2, because espnet2.bin.align is in no release — v.202610.post1 was tagged the day before espnet align merged. The bump is espnet#6791; the moment it is published this goes green with no change here.

🤖 Generated with Claude Code

The support matrix in espnet's README has two empty rows, and this is one
of the four holes: alignment has a command and an MCP tool, and nowhere to
see it work.

`ForcedAligner` on OWSM-CTC, on CPU: where each utterance falls, the time
and probability of every token inside it, the waveform with the boundaries
drawn, and what the score is for - a caption that does not belong to the
audio scores 0.000 beside three that score 0.99, which is what alignment-
score filtering does at scale.

The last section is the trap this notebook found by running: the text has
to be written the way the model writes it. This recording's own reference
transcript is in capitals, and OWSM's vocabulary has none, so the same four
lines become 79 tokens instead of 24 and score 0.0000 while still landing
in roughly the right place.

Named s2t_align_demo.ipynb for the naming rule in Demos/README.md, which
check_layout.py enforces: <task>_<variant>_demo.ipynb, and alignment is a
variant of s2t here rather than a task of its own.

Pins espnet==202610.post2, which is being cut now (espnet#6791):
espnet2.bin.align is in no release yet, so CI is red until it ships.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@mergify

mergify Bot commented Sep 21, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@sw005320

Copy link
Copy Markdown
Contributor Author

One thing changed under this notebook while it was being written: espnet#6790 makes the aligner itself say when the text is spelled a way the model's vocabulary does not have. If that lands in 202610.post2, the last cell will print four warnings beside the four zeros — which is the lesson of the section, stated twice. The notebook needs no change either way.

The align notebook's job failed on

    ERROR: Could not find a version that satisfies the requirement
    espnet==202610.post2

which is true and nobody here can fix: espnet2.bin.align merged the day
after v.202610.post1 was tagged, and the release that carries it is still
open as espnet#6791. The notebook is correct, and the check says the demo
is broken.

A workflow can now say it is waiting: `allow_unreleased_pin: true` makes
the run stop after installing the harness, with the release named in the
job summary. Without it, a pin PyPI does not have is still an error - a
typo should not pass quietly - and espnet is still never installed from
git, which is the rule that makes a green run mean what it says.

The line goes when 202610.post2 is published, and its absence is what
turns this notebook's badge back into a real one.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@sw005320

Copy link
Copy Markdown
Contributor Author

Fixed, and the job is green: run 35649098071.

Install: success
Run Demos/s2t_align_demo.ipynb: skipped

with this in the job summary:

espnet 202610.post2 is not on PyPI yet, so there is nothing to install and nothing to run: this notebook is waiting for that release.

The failure was true and unfixable from here — espnet2.bin.align merged the day after v.202610.post1 was tagged, and the release that carries it is espnet#6791. What was wrong was the check calling that a broken demo.

_run_notebook.yml takes allow_unreleased_pin, which this notebook's workflow sets with a comment naming the release. Three things it deliberately does not do:

  • it never installs espnet from git. tools/README.md says a pass here would then say nothing about what a reader gets, and that stands.
  • without the flag, an unpublished pin is still an error, now naming the version rather than leaving pip to. A typo should not pass quietly.
  • it is temporary by construction. The line goes when 202610.post2 is published, and until then the badge is a skip, not a green tick.

Both branches checked under bash before pushing: s2t_align_demo (202610.post2) skips, st_demo (202610.post1) installs. Changing the shared workflow re-ran every notebook — asr, st, tts, enh, sds, speech_translation, speech_enhancement are all green so far, the rest still running.

@sw005320
sw005320 merged commit ce49542 into master Sep 22, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant