Updated the LLM prompt to enforce acoustic/phoenetic similarity requirements for proposed corrections
This commit is contained in:
34
tests/test_prompts.py
Normal file
34
tests/test_prompts.py
Normal file
@@ -0,0 +1,34 @@
|
||||
from audita.chunking import chunk_transcript
|
||||
from audita.prompts import build_glossary_correction_messages
|
||||
from audita.schemas import parse_glossary_yaml, parse_transcript_json
|
||||
|
||||
|
||||
def test_prompt_requires_acoustically_plausible_transcription_errors():
|
||||
transcript = parse_transcript_json(
|
||||
"""
|
||||
[
|
||||
{"speaker": "Eric", "start": 0.0, "end": 1.0, "text": "The gestures are nearby."}
|
||||
]
|
||||
"""
|
||||
)
|
||||
glossary = parse_glossary_yaml(
|
||||
"""
|
||||
glossary:
|
||||
- name: "Jesters"
|
||||
category: faction
|
||||
summary: "The Jesters are a local faction."
|
||||
- name: "Lyra"
|
||||
category: npc
|
||||
summary: "Lyra is a hostile NPC."
|
||||
"""
|
||||
)
|
||||
section = chunk_transcript(transcript, max_section_tokens=16000)[0]
|
||||
|
||||
messages = build_glossary_correction_messages(section, glossary)
|
||||
prompt_text = "\n".join(message["content"] for message in messages)
|
||||
|
||||
assert "acoustically plausible" in prompt_text
|
||||
assert "phonetically or acoustically similar" in prompt_text
|
||||
assert '"gestures" to "Jesters"' in prompt_text
|
||||
assert '"Lyra" to "Jesters"' in prompt_text
|
||||
assert "should be omitted" in prompt_text
|
||||
Reference in New Issue
Block a user