Skip to content
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

Merged
merged 9 commits into from
Aug 21, 2024
Merged

Conversation

ja7811
Copy link
Member

@ja7811 ja7811 commented Aug 20, 2024

이슈 #41 번 참고해주시면 좋을 것 같습니다
파파고로 번역하니까 어투가 매번 달라지는 이슈가 있어서 ChatGPT한테 맡겼습니다
시간은 조금 더 소요되긴 하는데 훨씬 자연스러워요 (#63 코멘트 참고)

변경점

TranslationService

  • 인터페이스로 바꿨습니다

PapagoTranslationService (구 TranslationService)

  • 예전에 TranslationService였던 클래스입니다
    새로 만든 TranslationService 인터페이스의 구현체로 남겨뒀습니다
    (코드는 언젠가 쓸 수도 있으므로)

ChatGptTranslationService

  • 새로 만든 클래스입니다
    ChatGPT API로 번역을 담당합니다
  • 마찬가지로 TranslationService의 구현체고,
    현재는 얘를 빈으로 등록해놔서 번역할 때 이 클래스가 쓰입니다

(closes #63, #41)

@ja7811 ja7811 added the 💡 ENHANCEMENT Feature enhancement label Aug 20, 2024
@ja7811 ja7811 self-assigned this Aug 20, 2024
@ja7811 ja7811 linked an issue Aug 20, 2024 that may be closed by this pull request
- 그러지 말라고 프롬프트로 주의시킴
@ja7811 ja7811 requested a review from yuuddin August 20, 2024 11:34
@ja7811 ja7811 linked an issue Aug 20, 2024 that may be closed by this pull request
@@ -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());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다 !!
나중에 이런 로그 다 지우나요??

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logger로 다른 파일 등에 적도록 바꿀 계획입니다,,
나중에 너무 느려지면 어디부터 바꿔야할지 알아야할 거 같아서 남겨둘려고요

@yuuddin
Copy link
Collaborator

yuuddin commented Aug 20, 2024

어 키워드 한국어로 입력 됐을 때 script에 해당 키워드가 한국어로 나와요
이 부분 gpt prompt generator 마지막에 "키워드까지 해당 언어로 바꿔서 말해줘" 라는 명령문 추가하면 어떨 까요??

- TranslateService에 translateToMemberLanguage 메서드 추가
@ja7811
Copy link
Member Author

ja7811 commented Aug 20, 2024

어 키워드 한국어로 입력 됐을 때 script에 해당 키워드가 한국어로 나와요 이 부분 gpt prompt generator 마지막에 "키워드까지 해당 언어로 바꿔서 말해줘" 라는 명령문 추가하면 어떨 까요??

푸쉬했습니당

- 그러지 말라고 프롬프트로 한번 더 주의시킴
@ja7811 ja7811 merged commit 90d7314 into develop Aug 21, 2024
@ja7811 ja7811 deleted the enhance/translation/63 branch August 25, 2024 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💡 ENHANCEMENT Feature enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

스크립트 번역 개선 파파고 번역 품질 관련..
2 participants