diff --git a/README.md b/README.md index 670a976..b58e08c 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ Global flags: | `--output-modules` | No | `json` | Comma-separated output modules. | | `--output-schema` | No | `seriatim` | JSON output contract. Allowed values are `seriatim` and `minimal`. | | `--preprocessing-modules` | No | `validate-raw,normalize-speakers,trim-text` | Comma-separated preprocessing modules, evaluated in order. | -| `--postprocessing-modules` | No | `detect-overlaps,resolve-overlaps,backchannel,filler,coalesce,resolve-danglers,detect-overlaps,autocorrect,assign-ids,validate-output` | Comma-separated postprocessing modules, evaluated in order. | +| `--postprocessing-modules` | No | `detect-overlaps,resolve-overlaps,backchannel,filler,resolve-danglers,coalesce,detect-overlaps,autocorrect,assign-ids,validate-output` | Comma-separated postprocessing modules, evaluated in order. | | `--coalesce-gap` | No | `3.0` | Maximum same-speaker gap in seconds for `coalesce`; also used as the `resolve-overlaps` context window. Must be a non-negative float. | Environment variables: @@ -265,7 +265,7 @@ Overlap behavior: ## Overlap Resolution -The default postprocessing pipeline runs `detect-overlaps`, then `resolve-overlaps`, then `backchannel`, then `filler`, then `coalesce`, then `resolve-danglers`, then a second `detect-overlaps` pass. +The default postprocessing pipeline runs `detect-overlaps`, then `resolve-overlaps`, then `backchannel`, then `filler`, then `resolve-danglers`, then `coalesce`, then a second `detect-overlaps` pass. For each detected overlap group, `resolve-overlaps` uses preserved WhisperX word timing to build smaller word-run replacement segments: @@ -309,23 +309,23 @@ The default pipeline runs `filler` after `backchannel` and before `coalesce`. It Filler matching is case-insensitive, ignores punctuation for matching and word-count purposes, trims surrounding whitespace, and requires only filler tokens such as `um`, `uh`, `er`, `erm`, `ah`, `eh`, `hmm`, `mm`, or repeated combinations of those tokens. Matching segments must contain no more than three whitespace-delimited words and have duration no greater than `SERIATIM_FILLER_MAX_DURATION` seconds. The default maximum duration is `1.25` seconds. -## Coalescing - -The default pipeline runs `coalesce` before `resolve-danglers` and the second overlap detection pass. It merges adjacent same-speaker segments in the transcript's current order when `next.start - current.end <= --coalesce-gap`. - -Coalesced segments use `source_ref` values such as `coalesce:1`, include `derived_from`, and omit `source_segment_index`. - -Different-speaker backchannel and filler segments do not block coalescing of surrounding same-speaker segments. Same-speaker backchannel and filler segments are merged normally when they are within `--coalesce-gap`. When same-speaker segments are coalesced, any `backchannel` or `filler` category from the merged inputs is dropped from the coalesced segment. - ## Dangler Resolution -The default pipeline runs `resolve-danglers` after `coalesce` and before the second overlap detection pass. It repairs short derived fragments when they share provenance with a nearby segment: +The default pipeline runs `resolve-danglers` before `coalesce` and before the second overlap detection pass. It repairs short derived fragments when they share provenance with a nearby segment: - Dangling-end fragments have no more than two words and end in punctuation. - Dangling-start fragments have no more than two words. - Matching uses any shared `derived_from` value. - Merged segments use `source_ref` values such as `resolve-danglers:1`, keep the target segment's transcript position, and union `derived_from`. +## Coalescing + +The default pipeline runs `coalesce` after `resolve-danglers` and the second overlap detection pass. It merges adjacent same-speaker segments in the transcript's current order when `next.start - current.end <= --coalesce-gap`. + +Coalesced segments use `source_ref` values such as `coalesce:1`, include `derived_from`, and omit `source_segment_index`. + +Different-speaker backchannel and filler segments do not block coalescing of surrounding same-speaker segments. Same-speaker backchannel and filler segments are merged normally when they are within `--coalesce-gap`. When same-speaker segments are coalesced, any `backchannel` or `filler` category from the merged inputs is dropped from the coalesced segment. + ## Autocorrect Autocorrect is included in the default postprocessing pipeline. If `--autocorrect` is omitted, the module leaves transcript text unchanged and records a skip event in the optional report. diff --git a/architecture.md b/architecture.md index 7eca34e..9f5e011 100644 --- a/architecture.md +++ b/architecture.md @@ -146,7 +146,7 @@ The postprocessing stage applies zero or more modules to the merged transcript. Postprocessing modules are selected at runtime with a comma-separated list of canonical module names: ```text ---postprocessing-modules detect-overlaps,resolve-overlaps,backchannel,filler,coalesce,resolve-danglers,detect-overlaps,autocorrect,assign-ids,validate-output +--postprocessing-modules detect-overlaps,resolve-overlaps,backchannel,filler,resolve-danglers,coalesce,detect-overlaps,autocorrect,assign-ids,validate-output ``` Modules run in the exact order provided. Unknown module names are configuration errors. @@ -214,7 +214,7 @@ seriatim merge \ --speakers speakers.yml \ --autocorrect autocorrect.yml \ --preprocessing-modules validate-raw,normalize-speakers,trim-text \ - --postprocessing-modules detect-overlaps,resolve-overlaps,backchannel,filler,coalesce,resolve-danglers,detect-overlaps,autocorrect,assign-ids,validate-output \ + --postprocessing-modules detect-overlaps,resolve-overlaps,backchannel,filler,resolve-danglers,coalesce,detect-overlaps,autocorrect,assign-ids,validate-output \ --output-modules json \ --output-schema seriatim \ --output-file merged.json \ @@ -435,7 +435,7 @@ validate-raw,normalize-speakers,trim-text Recommended default postprocessing modules: ```text -detect-overlaps,resolve-overlaps,backchannel,filler,coalesce,resolve-danglers,detect-overlaps,autocorrect,assign-ids,validate-output +detect-overlaps,resolve-overlaps,backchannel,filler,resolve-danglers,coalesce,detect-overlaps,autocorrect,assign-ids,validate-output ``` The default output module is: