Skip to content

Transcript derivation module: sentences, gap ticks, backchannel bridges #68

Description

@dmwyatt

Part of #66. Foundation for the labeling UI, the future LLM prompt builder, and the eval scorer, all of which must share identical semantics.

Scope

A module of pure functions (no I/O) over utterance sequences:

  • Sentence segmentation: split utterance text into sentences. Utterance texts are complete punctuated sentences (see docs/transcript-segmentation.md), so this is boundary detection on terminal punctuation, with care for quotes/ellipses. Sentence indices become the addressing scheme for sub-utterance labels, so this function defines their meaning.
  • Gap ticks: for consecutive same-channel utterances, flag junctions where the silence (next.start - prev.end) exceeds a threshold (2s to start). ~19% of intra-run junctions exceed 2s; these are candidate turn boundaries.
  • Backchannel bridges: flag short microphone utterances that overlap (or nearly abut) surrounding system speech. These are listener acknowledgments, not turns; consumers should not treat them as run boundaries. ~9% of mic utterances overlap system speech.
  • Run grouping: group consecutive system utterances into gap-bounded sub-runs, flowing across bridges.

Requirements

  • Expose a SEGMENTATION_VERSION constant; bump on any change to these algorithms. Exports and stored labels reference it (see storage issue).
  • Thresholds as named constants, not magic numbers.
  • Unit tests, including a synthetic fixture covering: fused two-speaker utterance, multi-sentence monologue, backchannel with negative gap (overlap), pause with no speaker change, speaker change with no pause.

Reference

The JS in docs/prototypes/labeling-ui.html (sentences(), TICK, BRIDGE, queueItems()) is the reference implementation to port; its synthetic transcript is a starting point for the test fixture. After this module ships, that JS gets deleted from the template in favor of payload fields.

Metadata

Metadata

Assignees

No one assigned

    Labels

    prio: p2Medium priority, normal queuesize: mMedium, a few hours to a daystatus: readyReady to be worked ontype: featureNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions