General Introduction
Bilingual Book Maker is an open source project designed to help users create multilingual versions of eBooks using AI technology. The tool mainly uses ChatGPT for translation and supports a variety of file formats, including epub, txt and srt. Bilingual Book Maker is designed for translating eBooks that are in the public domain, and is not applicable to copyrighted works. Users need to prepare the API key for ChatGPT or OpenAI and provide the eBook file to be translated. The program supports a variety of AI models, such as GPT-4, GPT-3.5-turbo, etc. Users can choose different models for translation according to their needs.
Function List
- Multi-language support: Support for translating eBooks into multiple languages.
- File format compatibility: supports epub, txt and srt file formats.
- Multi-model selection: Supports a variety of AI models such as GPT-4, GPT-3.5-turbo, and so on.
- API Key Management: Support multiple API keys to reduce errors caused by API call limitations.
- Environment Configuration: Supports Python 3.8+ and provides detailed installation and usage instructions.
- Sample Books: Sample books for testing are provided for quick start.
Using Help
Installation process
- Preparing the environment: Ensure that the system has Python 3.8+ installed and has Internet access or a proxy.
- cloning project: Run the following command in the terminal to clone the project:
git clone https://github.com/yihong0618/bilingual_book_maker.git
cd bilingual_book_maker
- Installation of dependencies: Run the following command to install the project dependencies:
pip install -r requirements.txt
- Configuring the API Key: Set the OpenAI API key as an environment variable or specify it when running commands:
export BBM_OPENAI_API_KEY=your_openai_key
Usage Process
- Preparation of book documents: Place the epub or txt file to be translated in the project directory.
- Run the translation command: Use the following command to translate:
python3 make_book.py --book_name your_book.epub --openai_key your_openai_key
Or use the pip install command:
pip install -U bbook_maker
bbook --book_name your_book.epub --openai_key your_openai_key
- Selecting a Translation Model: The GPT-3.5-turbo model is used by default and can be accessed via the
---model
parameter specifies other models:
python3 make_book.py --book_name your_book.epub --openai_key your_openai_key --model gpt4
- View translation results: Once the translation is complete, the resulting bilingual eBook will be saved in the project directory under the filename
your_book_bilingual.epub
The
Detailed Function Operation
- Multi-API key support: If there is more than one API key, it can be specified in the command separated by commas to reduce errors caused by API call restrictions:
python3 make_book.py --book_name your_book.epub --openai_key key1,key2,key3
- Translation label designation: only translates by default
<p>
Tagged content, which can be accessed via the---translate-tags
parameter specifies additional labels:
python3 make_book.py --book_name your_book.epub --openai_key your_openai_key --translate-tags h1,h2,h3,p,div
- Proxy Settings: If you need to use a proxy, you can pass the
--proxy
parameter specifies the proxy server:
python3 make_book.py --book_name your_book.epub --openai_key your_openai_key --proxy http://127.0.0.1:7890
- Disruption Recovery: If the translation process is interrupted, you can use the
--resume
Parameters are manually restored:
python3 make_book.py --book_name your_book.epub --openai_key your_openai_key --resume