fix(meeting): stop learned vocabulary from rewriting ordinary Korean
The first cut replaced any Hangul word within one jamo of a learned term. Measured against the real local corpus (three stored meeting transcripts) it changed 286 of 3,005 words: 하면 became 라면, 이제 became 이게, 매일 became 메일. Most of what the app learns from typing is ordinary grammar, so distance alone cannot separate a misheard word from a correct one. Deterministic correction now covers only dictionary pronunciations and the Latin identifiers the user types, preserving their casing. Korean terms still bias recognition through the prompt hint and guide the polish prompt. Re-measured on the same transcripts: 0 of 3,005 words changed. Hangul-layout typing artifacts (dkssudgktpdy) are dropped from the hint.
This commit is contained in:
parent
a21de78303
commit
72e9b7c18b
7 changed files with 116 additions and 101 deletions
|
|
@ -90,33 +90,45 @@ describe('replaceDictionaryTerms', () => {
|
|||
|
||||
describe('correctLearnedTerms', () => {
|
||||
const glossary = buildTranscriptGlossary({
|
||||
phrases: phrases(['회의록 정리해줘', 6], ['전사 교정', 4]),
|
||||
phrases: phrases(['VSCode 설정 열기', 6], ['D3RO Voice 녹음', 4]),
|
||||
})
|
||||
|
||||
it('1자모 차이 나는 전사 어절을 학습 어절로 되돌린다', () => {
|
||||
const result = correctLearnedTerms('회이록 정리해줘', glossary)
|
||||
it('학습한 식별자와 한 글자 다른 전사 어절을 되돌린다', () => {
|
||||
const result = correctLearnedTerms('VSCod 설정 열기', glossary)
|
||||
|
||||
expect(result.text).toBe('회의록 정리해줘')
|
||||
expect(result.corrections).toEqual([{ from: '회이록', to: '회의록', source: 'learned' }])
|
||||
expect(result.text).toBe('VSCode 설정 열기')
|
||||
expect(result.corrections).toEqual([{ from: 'VSCod', to: 'VSCode', source: 'learned' }])
|
||||
})
|
||||
|
||||
it('조사는 붙인 채로 어절만 고친다', () => {
|
||||
expect(correctLearnedTerms('회이록은 좋다', glossary).text).toBe('회의록은 좋다')
|
||||
})
|
||||
it('이미 맞게 적힌 식별자는 건드리지 않는다', () => {
|
||||
const result = correctLearnedTerms('VSCode 설정 열기', glossary)
|
||||
|
||||
it('사용자가 실제로 쓴 어절은 건드리지 않는다', () => {
|
||||
const result = correctLearnedTerms('회의록 정리해줘', glossary)
|
||||
|
||||
expect(result.text).toBe('회의록 정리해줘')
|
||||
expect(result.text).toBe('VSCode 설정 열기')
|
||||
expect(result.corrections).toEqual([])
|
||||
})
|
||||
|
||||
it('한글 어절은 1자모만 달라도 고치지 않는다', () => {
|
||||
// 실사용 코퍼스 측정: 한글까지 고치면 정상 문장이 대량으로 망가졌다(하면→라면, 이제→이게 …).
|
||||
const korean = buildTranscriptGlossary({
|
||||
phrases: phrases(['회의록 정리해줘', 6], ['라면 먹고 싶다', 5]),
|
||||
})
|
||||
|
||||
expect(correctLearnedTerms('회이록 정리해줘', korean).text).toBe('회이록 정리해줘')
|
||||
expect(correctLearnedTerms('하면 좋겠다', korean).text).toBe('하면 좋겠다')
|
||||
})
|
||||
|
||||
it('후보가 둘 이상이면(동률) 고치지 않는다', () => {
|
||||
const tied = buildTranscriptGlossary({
|
||||
phrases: phrases(['정리해', 4], ['정리히', 4]),
|
||||
phrases: phrases(['vscode 사용', 4], ['vscodf 사용', 4]),
|
||||
})
|
||||
|
||||
expect(correctLearnedTerms('정리하', tied).text).toBe('정리하')
|
||||
expect(correctLearnedTerms('vscodd', tied).text).toBe('vscodd')
|
||||
})
|
||||
|
||||
it('너무 짧은 식별자·한 글자 어절은 대상이 아니다', () => {
|
||||
const shortTerms = buildTranscriptGlossary({ phrases: phrases(['api 서버', 9]) })
|
||||
|
||||
expect(correctLearnedTerms('ap 서버', shortTerms).text).toBe('ap 서버')
|
||||
})
|
||||
|
||||
it('어휘가 없으면 원문을 그대로 돌려준다', () => {
|
||||
|
|
@ -124,15 +136,6 @@ describe('correctLearnedTerms', () => {
|
|||
|
||||
expect(result).toEqual({ text: '아무 말이나 적는다', corrections: [] })
|
||||
})
|
||||
|
||||
it('사전 정본 표기가 학습 어절보다 우선한다', () => {
|
||||
const withDictionary = buildTranscriptGlossary({
|
||||
dictionary: [{ word: '회의록', pronunciation: null }],
|
||||
phrases: phrases(['회의녹 정리', 9]),
|
||||
})
|
||||
|
||||
expect(correctLearnedTerms('회이록 정리', withDictionary).text).toBe('회의록 정리')
|
||||
})
|
||||
})
|
||||
|
||||
describe('LLM 교열 참고 블록', () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue