음성 추가 탭을 구현합니다. - #15
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Situation
SpendLearning은 소비 전용 가계부 앱으로, 지금까지 지출 기록은 카테고리를 먼저 고르고 금액/메모를 입력하는 수동 방식만 지원했다. 매번 앱을 켜서 카테고리 목록을 훑고 입력하는 과정이 번거로워, 음성으로 더 빠르게 기록할 수 있는 수단이 필요했다. 다만 카테고리는 사용자가 자유롭게 추가/수정하는 가변적인 값이라, 고정된 클래스로 카테고리를 예측하는 일반적인 분류 모델은 이 앱의 구조와 맞지 않았다.
Task
Action
모델 설계 및 학습 파이프라인 구축
coremltools)으로 updatable kNN 분류기를 학습하는 스크립트(MLTraining/train.py)를 별도로 구성했다.NLEmbedding이 한국어를 지원하지 않는 것을 사전에 확인하고, 한글 자모(초성/중성/종성) 단위로 텍스트를 분해해 벡터화하는 방식을 직접 설계해 vocabulary 크기를 줄이면서도 처음 보는 상호명까지 넓게 커버할 수 있도록 했다.CategoryClassifier.mlmodel)과 vocabulary(vocabulary.json)를 앱 번들에 포함시키고,CategoryPredictor가 앱 실행 시 이를 쓰기 가능한 위치로 복사해 예측·온디바이스 재학습(MLUpdateTask)을 수행하도록 구현했다.음성 입력 파이프라인
VoiceExpenseParser로 "메모 금액원" 형식의 발화에서 금액과 메모를 정규식 기반으로 분리하고, 자연스러운 어순("~썼어" 등)까지 지원하도록 반복 검증했다.VoiceExpenseViewModel이Speech/AVAudioEngine으로 온디바이스 음성 인식을 수행하고, 파싱 및 카테고리 예측 결과를 기존 저장 흐름(NewExpenseViewModel)에 연결했다.UIHostingController중첩 환경에서fullScreenCover가 동작하지 않는 문제를 발견해 UIKit으로 재작성했다.기존 화면 개선 및 버그 수정
ExpenseInputViewController를 카테고리/금액/메모를 한 화면에서 확인·수정할 수 있는 카드 UI로 재구성하고, 음성 흐름과 기존 수동 추가 흐름이 이 화면을 공유하도록 했다..mlmodel을 빌드 시.mlmodelc로 컴파일해 번들에는 원본이 남지 않는다는 사실을 실기기 디버깅으로 발견해, 예측이 항상 "기타"로만 나오던 버그를 수정했다.CategoryPredictor도 함께 초기화하도록 연결했다.Result
SettingsViewModelTests는SettingsViewModel생성자 시그니처 변경에 맞춰 갱신했다.