fix(meeting): keep polish from inventing markers or dropping qualifiers
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.
This commit is contained in:
parent
bcd0cf4f23
commit
3aa68f466c
8 changed files with 167 additions and 5 deletions
|
|
@ -39,7 +39,7 @@ vi.mock('../../src/main/services/PremiumLLMService', () => ({
|
|||
|
||||
useRedHarness()
|
||||
|
||||
function insertSession(id: string): void {
|
||||
function insertSession(id: string, transcript: string = USER_TEXT.KO): void {
|
||||
const now = Date.now()
|
||||
getDatabase()
|
||||
.insert(meetingSessions)
|
||||
|
|
@ -50,7 +50,7 @@ function insertSession(id: string): void {
|
|||
startedAt: now,
|
||||
createdAt: now,
|
||||
updatedAt: now,
|
||||
rawTranscript: USER_TEXT.KO,
|
||||
rawTranscript: transcript,
|
||||
})
|
||||
.run()
|
||||
}
|
||||
|
|
@ -85,7 +85,7 @@ describe('유스케이스: 회의 문서/폴리시가 로컬 LLM 을 탄다', ()
|
|||
it('polish 는 모델이 되돌린 사전 표기를 학습 표기로 다시 강제한다', async () => {
|
||||
configSet('llmBackend', 'local')
|
||||
getDictionaryService().add({ word: 'D3RO', pronunciation: '디에로' })
|
||||
insertSession('meet-polish-dict')
|
||||
insertSession('meet-polish-dict', '[00:01] 디에로 보이스 설정 확인해 주세요')
|
||||
localGenerate.mockClear()
|
||||
// 모델이 사전 표기를 무시하고 발음 그대로 돌려준 상황
|
||||
localGenerate.mockResolvedValueOnce({ text: '[00:01] 디에로 보이스 설정 확인해 주세요', model: 'fx-local-model' })
|
||||
|
|
@ -97,6 +97,32 @@ describe('유스케이스: 회의 문서/폴리시가 로컬 LLM 을 탄다', ()
|
|||
expect(systemPrompt).toContain('[사용자 용어')
|
||||
expect(systemPrompt).toContain('D3RO')
|
||||
})
|
||||
it('모델이 붙인 없는 시각·화자 표기는 저장 전에 지운다', async () => {
|
||||
configSet('llmBackend', 'local')
|
||||
insertSession('meet-polish-markers')
|
||||
localGenerate.mockClear()
|
||||
// 원문에는 [MM:SS]·[화자 N] 이 없다 — 모델이 형식을 만들어 냈다.
|
||||
localGenerate.mockResolvedValueOnce({
|
||||
text: '[00:00] [화자 1] 오늘 회의는 오후 세 시에 시작합니다',
|
||||
model: 'fx-local-model',
|
||||
})
|
||||
|
||||
const polished = await getMeetingModeService().polishTranscript('meet-polish-markers')
|
||||
|
||||
expect(polished).toBe(USER_TEXT.KO)
|
||||
expect(polished).not.toContain('[00:00]')
|
||||
expect(polished).not.toContain('[화자')
|
||||
})
|
||||
it('모델이 지운 의미 한정 부사는 원문 근거로 되돌린다', async () => {
|
||||
configSet('llmBackend', 'local')
|
||||
insertSession('meet-polish-qualifier', '사실 거의 근간이라고 봅니다')
|
||||
localGenerate.mockClear()
|
||||
localGenerate.mockResolvedValueOnce({ text: '사실 근간이라고 봅니다', model: 'fx-local-model' })
|
||||
|
||||
const polished = await getMeetingModeService().polishTranscript('meet-polish-qualifier')
|
||||
|
||||
expect(polished).toBe('사실 거의 근간이라고 봅니다')
|
||||
})
|
||||
it('없는 세션 polish 는 MeetingSessionNotFound 다', async () => {
|
||||
configSet('llmBackend', 'local')
|
||||
await expect(getMeetingModeService().polishTranscript('missing')).rejects.toMatchObject({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue