fix: keep chunk details out of speaker headers
Render transcript-wide speaker numbers instead of exposing upload chunks in reader-facing headers. Reconcile adjacent requests using at least two unambiguous word-and-time matches in their shared audio, including when provider speaker IDs change between requests. Reject conflicting mappings and never treat matching numeric provider IDs as identity evidence. Assign fresh IDs where continuity cannot be established and report that uncertainty on stderr. Number only speakers retained after overlap trimming. Document that overlap matching cannot identify a returning speaker who was absent from the overlap, and add the reader-facing boundary to AGENTS.md. Test Plan: - python3 -B -m unittest -v: all 46 tests passed, including swapped IDs, ambiguous evidence, continuity across three requests, and plain headers. - git diff --cached --check: passed. - Tests use synthetic speaker labels; live diarization accuracy was not verified because provider credentials are unavailable in this environment.
This commit is contained in:
1 parent
6e94379a25
commit
5dd1b5811b
7 files changed
+129
-32
No files matched your search
+2
-2
@@ -22,13 +22,13 @@ class TranscriptTests(unittest.TestCase):
|
||||
))
|
||||
self.assertEqual(response, original)
|
||||
|
||||
def test_speaker_ids_are_scoped_to_chunks_even_when_numbers_match(self):
|
||||
def test_unmatched_speakers_get_separate_ids_without_chunk_headers(self):
|
||||
response = merge(
|
||||
[{"start": 0, "end": 63, "seam": 0}, {"start": 57, "end": 100, "seam": 60}],
|
||||
[{"words": [word("First.", 1, 0)]}, {"words": [word("Second.", 10, 0)]}],
|
||||
)
|
||||
self.assertEqual(render_text(response), (
|
||||
"[Chunk 1, Speaker 0]\nFirst.\n\n[Chunk 2, Speaker 0]\nSecond.\n"
|
||||
"[Speaker 0]\nFirst.\n\n[Speaker 1]\nSecond.\n"
|
||||
))
|
||||
|
||||
def test_long_unpunctuated_turn_is_wrapped_and_split_without_losing_words(self):
|
||||
|
||||
Reference in new issue
Block a user