oomol-lab/epub-translator
Translate EPUB books using Large Language Models while preserving the original text. The translated content is displayed side-by-side with the original, creating bilingual books perfect for language learning and cross-reference reading.
What it solves
EPUB Translator allows readers to translate foreign language books while keeping the original text for context. It converts standard EPUB files into bilingual editions, ensuring that formatting, images, and the book's structure are preserved during the translation process.
How it works
The tool uses Large Language Models (LLMs) via API to translate text segments. It offers three insertion modes for the translated content:
- Replace: Swaps the original text with the translation for a single-language book.
- Append Text: Adds the translation inline, immediately following the original text.
- Append Block: Inserts the translation as a separate paragraph (block element) after the original, which is recommended for side-by-side reading.
It features a dual-LLM architecture where users can assign different models or settings (like temperature) to the translation task and the XML structure filling task to optimize quality and structure preservation.
Who it’s for
- Language Learners: People who want to read foreign literature with a reference translation available.
- Researchers: Academic users who need to translate technical documents while maintaining original context.
- Developers: Those looking to integrate EPUB translation into their own Python applications using the provided API.
Highlights
- Bilingual Output: Supports side-by-side translation layouts.
- Dual-LLM Architecture: Ability to use separate models for translation and structure preservation.
- Concurrent Translation: Parallel processing of text segments to speed up the process for large books.
- Progress Recovery: Caching mechanisms to resume translation after a failure.
- Token Monitoring: Built-in tracking of input and output tokens to monitor API costs.
- OpenAI Compatible: Works with OpenAI, Azure OpenAI, and any other OpenAI-compatible API service.
Related
- Project
- Project
- Project
- Project