[FEAT] 온디바이스 일기 요약 기능 추가 (KoBART + ONNX Runtime) - #9
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.
Describe
온디바이스(폰 안에서 직접 돌아가는) KoBART 모델로 일기 요약 기능을 만들었습니다. 채팅은 여러 번에 나눠서 입력되니까, 사용자가 입력할 때마다 그 내용을 계속 모아두다가 대화가 끝나면 판단합니다. 모아둔 글자수가 140자보다 적으면 굳이 요약할 필요가 없어서 원문 그대로 쓰고, 140자 이상이면 반드시 모델을 돌려서 요약한 걸 씁니다.
Works made
사용 모델 + 구현 방식
onnxruntime-objc, CocoaPods로 추가한 라이브러리)을 사용했습니다.swift-transformers라이브러리를 씁니다. 이 파일 이름이 감정분석 기능의 파일이랑 겹쳐서, 따로 임시 폴더를 만들어 그 안에서 읽도록 처리했습니다.로직: 여러 번 입력받은 걸 모았다가 한 번에 판단
addUtterance)와 "다 모으고 나서 최종 판단하기"(finalize) 두 단계로 나눴습니다.테스트용 화면
Changes Made
As-Is
기존 로직
To-Be
변경 로직
How to Test
GAMSSApp.swift에서 시작 화면을 잠깐SummaryTestView로 바꿔서 시뮬레이터/실기기에서 직접 여러 문장 입력해보고 "대화 종료" 눌러서 결과 확인 가능Issues Resolved
References