Skip to content

martinycleung/bilingual_book_maker

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bilingual_book_maker

Make bilingual epub books Using AI translate

image

准备

  1. ChatGPT or OpenAI token
  2. epub books
  3. 能正常联网的环境或 proxy
  4. python3.8+

使用

  1. pip install -r requirements.txt
  2. OpenAI API key,如果有多个可以用英文逗号分隔(xxx,xxx,xxx),可以减少接口调用次数限制带来的错误
  3. 本地放了一个 animal_farm.epub 给大家测试
  4. 默认用了 ChatGPT 模型,用 --model gpt3 来使用 gpt3 模型
  5. 加了 --test 命令如果大家没付费可以加上这个先看看效果(有 limit 稍微有些慢)
  6. Set the target language like --language "Simplified Chinese". Suppot "Japanese" / "Traditional Chinese" / "German" / "French" / "Korean". Default target language is "Simplified Chinese". Support language list please see the LANGUAGES at utils.py.
  7. 加了 --proxy 参数,方便中国大陆的用户在本地测试时使用代理,传入类似 http://127.0.0.1:7890 的字符串
  8. 加入 --resume 命令,可以手动中断后,加入命令继续执行。

e.g.

# 如果你想快速测一下
python3 make_book.py --book_name test_books/animal_farm.epub --openai_key ${openai_key} --no_limit --test --language "Simplified Chinese"
# or do it
python3 make_book.py --book_name test_books/animal_farm.epub --openai_key ${openai_key} --language "Simplified Chinese"
# or 用 gpt3 模型
export OPENAI_API_KEY=${your_api_key}
python3 make_book.py --book_name test_books/animal_farm.epub --model gpt3 --no_limit --language "Simplified Chinese"

注意

  1. 有 limit 如果想要速度可以付费
  2. 现在是 demo 版本有很多工作要做 PR welcome
  3. 尤其是 batch translate 做完效果会好很多
  4. DeepL 模型稍后更新

感谢

贡献

  • 任何 issue PR 都欢迎
  • Issue 中有些 TODO 没做的都可以选
  • 提交代码前请先 black make_book.py

赞赏

谢谢就够了

image

About

Make bilingual epub books Using AI translate

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%