Updated the spoken-word module prompts to preserve intentional emphatic repetition

This commit is contained in:
2026-04-25 14:46:19 -05:00
parent a255ff28b7
commit b9eef0043b
4 changed files with 10 additions and 0 deletions

View File

@@ -102,6 +102,9 @@ def build_spoken_word_proposal_messages(section: TranscriptSection, glossary: Gl
"Rules:\n" "Rules:\n"
"- Approve only conservative cleanup of repeated words, repeated short phrases, filler words, hesitation artifacts, and similar spoken dysfluencies.\n" "- Approve only conservative cleanup of repeated words, repeated short phrases, filler words, hesitation artifacts, and similar spoken dysfluencies.\n"
"- You may collapse adjacent repetition such as \"I I think\" to \"I think\" or remove filler spans such as \"you know\" or \"uh\" when local context supports that cleanup.\n" "- You may collapse adjacent repetition such as \"I I think\" to \"I think\" or remove filler spans such as \"you know\" or \"uh\" when local context supports that cleanup.\n"
"- Do not collapse repeated words or short phrases when the repetition plausibly expresses urgency, excitement, insistence, or deliberate rhetorical emphasis rather than dysfluency.\n"
"- Phrases such as \"Help! Help! Help!\", \"Stop! Stop! Stop!\", \"No! No! No!\", \"Yes! Yes! Yes!\", and \"Go! Go! Go!\" are often intentional emphasis and should usually be preserved.\n"
"- Only collapse repetition when local context supports it as accidental spoken repetition, hesitation, or verbal restart.\n"
"- You may include low-risk punctuation, spacing, or capitalization cleanup when it is part of removing a dysfluency, such as removing ellipses or hesitation punctuation that no longer belongs after the cleanup.\n" "- You may include low-risk punctuation, spacing, or capitalization cleanup when it is part of removing a dysfluency, such as removing ellipses or hesitation punctuation that no longer belongs after the cleanup.\n"
"- Do not paraphrase, summarize, reorder ideas, replace content with different wording, or make substantive semantic edits.\n" "- Do not paraphrase, summarize, reorder ideas, replace content with different wording, or make substantive semantic edits.\n"
"- Do not change clear content words just because a different phrasing reads better.\n" "- Do not change clear content words just because a different phrasing reads better.\n"

View File

@@ -69,6 +69,9 @@ def build_spoken_word_messages(validation_payload: List[dict]) -> List[Message]:
"Rules:\n" "Rules:\n"
"- Return one validation decision for every correction_index in the input.\n" "- Return one validation decision for every correction_index in the input.\n"
"- Approve cleanup of repeated words, repeated short phrases, filler words, hesitation artifacts, and similar common spoken dysfluencies.\n" "- Approve cleanup of repeated words, repeated short phrases, filler words, hesitation artifacts, and similar common spoken dysfluencies.\n"
"- Reject repetition cleanup when the repetition plausibly serves urgency, excitement, insistence, or deliberate rhetorical emphasis rather than dysfluency.\n"
"- Phrases such as \"Help! Help! Help!\", \"Stop! Stop! Stop!\", \"No! No! No!\", \"Yes! Yes! Yes!\", and \"Go! Go! Go!\" are often intentional emphasis and should usually be preserved.\n"
"- Approve repetition cleanup only when local context supports it as accidental repetition, hesitation, or verbal restart.\n"
"- Approve minor punctuation, spacing, or capitalization cleanup only when it is plausibly part of removing a dysfluency.\n" "- Approve minor punctuation, spacing, or capitalization cleanup only when it is plausibly part of removing a dysfluency.\n"
"- Reject free-standing stylistic polishing, readability edits, paraphrases, and general rewriting.\n" "- Reject free-standing stylistic polishing, readability edits, paraphrases, and general rewriting.\n"
"- Reject edits that materially change the segment's substantive meaning, even if they are not literal antonyms.\n" "- Reject edits that materially change the segment's substantive meaning, even if they are not literal antonyms.\n"

View File

@@ -827,6 +827,8 @@ def test_spoken_word_prompt_emphasizes_dysfluency_cleanup():
combined = messages[0]["content"] + messages[1]["content"] combined = messages[0]["content"] + messages[1]["content"]
assert "dysfluencies" in combined assert "dysfluencies" in combined
assert "intentional emphasis" in combined
assert "Stop! Stop! Stop!" in combined
assert "punctuation" in combined assert "punctuation" in combined
assert "substantive meaning" in combined assert "substantive meaning" in combined
assert "original_segment_text" in messages[1]["content"] assert "original_segment_text" in messages[1]["content"]

View File

@@ -175,6 +175,8 @@ def test_spoken_word_prompt_is_explicitly_scoped_to_dysfluency_cleanup():
combined = messages[0]["content"] + messages[1]["content"] combined = messages[0]["content"] + messages[1]["content"]
assert "dysfluencies" in combined assert "dysfluencies" in combined
assert "intentional emphasis" in combined
assert "Help! Help! Help!" in combined
assert "punctuation" in combined assert "punctuation" in combined
assert "paraphrase" in combined assert "paraphrase" in combined
assert '"id": 1' in messages[1]["content"] assert '"id": 1' in messages[1]["content"]