The local model follows the polish instructions only most of the time: in repeated runs it added a [00:00] or [화자 1] marker that was never in the audio, and it turned "사실 거의 근간" into "사실 근간". Both change what the meeting record says, so they are now enforced in code instead of hoped for in the prompt: markers absent from the original chunk are stripped, and meaning qualifiers the speaker said are restored from that chunk. The instructions themselves were re-measured on the model: a fixed removal list, an explicit qualifier example and a marker ban keep the filler cleanup without touching ordinary words, and the same wording is used by the app, the tests and the probe. Unknown-word repair still depends on the model.
49 lines
2.4 KiB
TypeScript
49 lines
2.4 KiB
TypeScript
// tests/main/services/polish-prompt.test.ts
|
|
// 전사 AI 교열 프롬프트가 학습 용어를 근거로 쓰도록 지시하는지 (MTG-14).
|
|
|
|
import { describe, expect, it } from 'vitest'
|
|
import {
|
|
buildPolishTranscriptPrompt,
|
|
POLISH_TRANSCRIPT_RULES,
|
|
} from '../../../src/main/services/meeting/polish-prompt'
|
|
|
|
describe('전사 교열 프롬프트', () => {
|
|
it('학습 용어 오인식은 반드시 고치고, 근거 없는 단어 교체는 금지한다', () => {
|
|
expect(POLISH_TRANSCRIPT_RULES).toContain('반드시 그 표기로 고치세요')
|
|
expect(POLISH_TRANSCRIPT_RULES).toContain('일반 명사·부사·조사·어미는 절대 다른 단어로 바꾸지 마세요')
|
|
expect(POLISH_TRANSCRIPT_RULES).toContain('[사용자 용어]')
|
|
expect(POLISH_TRANSCRIPT_RULES).toContain('[사용자가 자주 쓰는 용어]')
|
|
})
|
|
|
|
it('지울 수 있는 것만 화이트리스트로 알려 준다', () => {
|
|
expect(POLISH_TRANSCRIPT_RULES).toContain('지울 수 있는 것은 다음뿐입니다')
|
|
expect(POLISH_TRANSCRIPT_RULES).toContain('이 목록에 없는 단어는 절대 빼거나 바꾸지 마세요')
|
|
})
|
|
|
|
it('의미를 한정하는 말을 빼지 말라는 예시를 준다', () => {
|
|
expect(POLISH_TRANSCRIPT_RULES).toContain('거의')
|
|
expect(POLISH_TRANSCRIPT_RULES).toContain('의미가 달라지므로 틀린 교열')
|
|
})
|
|
|
|
it('원문에 없는 화자 표기·타임스탬프를 새로 붙이지 말라고 지시한다', () => {
|
|
expect(POLISH_TRANSCRIPT_RULES).toContain('새로 붙이지 마세요')
|
|
})
|
|
it('타임스탬프·화자 표기와 말투를 유지하라고 지시한다', () => {
|
|
expect(POLISH_TRANSCRIPT_RULES).toContain('[MM:SS]')
|
|
expect(POLISH_TRANSCRIPT_RULES).toContain('화자 표기')
|
|
expect(POLISH_TRANSCRIPT_RULES).toContain('말투')
|
|
})
|
|
|
|
it('글로서리 블록은 규칙 뒤에 붙는다', () => {
|
|
const prompt = buildPolishTranscriptPrompt({ glossary: '[사용자 용어 — 이 표기를 그대로 쓰세요]\n- D3RO' })
|
|
|
|
expect(prompt.startsWith(POLISH_TRANSCRIPT_RULES)).toBe(true)
|
|
expect(prompt).toContain('D3RO')
|
|
expect(prompt.endsWith('- D3RO')).toBe(true)
|
|
})
|
|
|
|
it('글로서리가 없으면 규칙만 돌려준다', () => {
|
|
expect(buildPolishTranscriptPrompt()).toBe(POLISH_TRANSCRIPT_RULES)
|
|
expect(buildPolishTranscriptPrompt({ glossary: ' ' })).toBe(POLISH_TRANSCRIPT_RULES)
|
|
})
|
|
})
|