Skip to content

Issue: 배치 번역 중 JSON 파싱 및 entry 개수 불일치 오류 발생 #48

@sihyeon22

Description

@sihyeon22

관련 이슈
#32 #42

현재 상황 요약
최근 번역 구조를 entry 단위에서 batch 단위로 전환 후 아래와 같은 오류가 발생하고 있습니다:

  1. JSON 파싱 오류(json.JSONDecodeError)
    LLM이 유효한 JSON 형식으로 응답하지 못하는 경우
    -> "!!! JSON parsing failed, trying to extract array !!!" 로그 발생

  2. 번역 개수 불일치 오류
    LLM 응답의 번역 배열 길이(len(translations))가 입력 entry 개수(len(entries))와 일치하지 않는 경우
    -> 해당 배치 전체가 return None 되어, 번역 누락 발생

결과적으로 전체 번역 대상 entry 수(total_entries)와 번역 완료된 entry 수 간에 불일치가 생기고 있습니다.

해결 방향 제안

  1. JSON 파싱 실패 시 or entry 개수가 맞지 않을 때
    기존: 단순히 return None
    변경: msgstr을 빈 문자열로 return

  2. Fallback 구조(개별 entry 재번역) 도입
    번역 실패한 경우에 대해서 Queue로 저장해두고, batch 번역이 완료된 후에 이 Queue에 저장된 entry들을 line-by-line으로 번역 수행

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions