-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update: 스크립트 번역 개선 #71
Conversation
기존 TranslationService는 PapagoTranslationService로 변경 (TranslationService를 구현함)
- 그게 컨벤션이라네요
- 그러지 말라고 프롬프트로 주의시킴
@@ -66,7 +66,7 @@ private String getOpenAiResult(ChatCompletionRequest request){ | |||
Long startTime = System.currentTimeMillis(); | |||
ChatCompletionResult result = openAiService.createChatCompletion(request); | |||
Long endTime = System.currentTimeMillis(); | |||
System.out.printf("GPTTranslationService: chat took %d seconds, and consumed %d tokens total (prompt %d, completion %d)%n", (endTime-startTime)/1000, result.getUsage().getTotalTokens(), result.getUsage().getPromptTokens(), result.getUsage().getCompletionTokens()); | |||
System.out.printf("GPTTranslationService: translation took %d seconds, consumed %d tokens total (prompt %d, completion %d)%n", (endTime-startTime)/1000, result.getUsage().getTotalTokens(), result.getUsage().getPromptTokens(), result.getUsage().getCompletionTokens()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고하셨습니다 !!
나중에 이런 로그 다 지우나요??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logger로 다른 파일 등에 적도록 바꿀 계획입니다,,
나중에 너무 느려지면 어디부터 바꿔야할지 알아야할 거 같아서 남겨둘려고요
어 키워드 한국어로 입력 됐을 때 script에 해당 키워드가 한국어로 나와요 |
- TranslateService에 translateToMemberLanguage 메서드 추가
푸쉬했습니당 |
- 그러지 말라고 프롬프트로 한번 더 주의시킴
이슈 #41 번 참고해주시면 좋을 것 같습니다
파파고로 번역하니까 어투가 매번 달라지는 이슈가 있어서 ChatGPT한테 맡겼습니다
시간은 조금 더 소요되긴 하는데 훨씬 자연스러워요 (#63 코멘트 참고)
변경점
TranslationService
PapagoTranslationService (구 TranslationService)
TranslationService
였던 클래스입니다새로 만든
TranslationService
인터페이스의 구현체로 남겨뒀습니다(코드는 언젠가 쓸 수도 있으므로)
ChatGptTranslationService
ChatGPT API로 번역을 담당합니다
TranslationService
의 구현체고,현재는 얘를 빈으로 등록해놔서 번역할 때 이 클래스가 쓰입니다
(closes #63, #41)