1 line
317 KiB
JSON
1 line
317 KiB
JSON
{"repo": "bigdawnghost/wenyi", "files": {"config.yaml": {"9988ff062fc34fd48e1a46faa2c63b9c5c49e75a": {"t": 1785745209.119532, "n": 2730, "h": "4f90dbad24609698", "c": "# trans-novel 配置(多语言小说 → 中文)\n# 修改后无需改代码;模型提供商、流水线和输出开关都在这里。\n\nlanguage:\n source: auto # auto 由模型识别来源语言;也可写死 ja / en / ko / ru / de 等语言代码\n target: zh # 译文语言\n\n# ── LLM ──────────────────────────────────────────────────────────────────\nllm:\n # deepseek | openai | openrouter | openai-compatible | ollama | vllm | fake\n provider: deepseek\n base_url: https://api.deepseek.com\n api_key_env: DEEPSEEK_API_KEY\n timeout: 600\n max_retries: 4\n tiers:\n strong:\n model: deepseek-v4-pro\n options:\n thinking: true\n reasoning_effort: high\n cheap:\n model: deepseek-v4-flash\n options:\n thinking: true\n reasoning_effort: high\n fast:\n model: deepseek-v4-flash\n options:\n thinking: true\n\n# ── 切分 ─────────────────────────────────────────────────────────────────\nsegment:\n # 一个翻译批次(句群)的目标大小,按字符粗略估算 token。\n max_chars_per_batch: 1800\n # 单个段落超过该长度时按句末标点再切成多段(续段回填时并回同段),避免超长段。\n max_chars_per_segment: 1200\n\n# ── 流水线开关(质量/成本平衡)───────────────────────────────────────────\npipeline:\n review: false # 默认关闭;开启后在全书翻译完成后自动执行最终审校\n align_retry_limit: 2\n polish: true # 润色(强档):等于用 pro 把全书再翻一遍,最烧钱;默认开\n backtranslate_sample: 0 # 回译抽检比例(0 关闭)\n consistency_qa: false # 全书跨章一致性收尾扫描\n rolling_context_segments: 6 # 注入的前文译文尾段数\n book_understanding:\n true # 翻译前预扫源文,生成全书概览+逐章梗概注入翻译(让译者对全书有理解);\n # fast 档免思考,全书概览为恒定前缀可命中缓存复用;关掉省去预扫成本\n prescan_concurrency: 4 # 预扫逐章梗概的并发线程数(各章独立,1=串行)\n review_concurrency: 4 # 最终审校连续分块的并发数(只读最终译文/术语快照,1=串行)\n review_output_retries: 2 # 单段审校输出畸形时额外重试次数(初次+2=最多 3 次)\n review_agent_loop: true # 初审发现候选后,使用强档按需取证并复核\n review_agent_tier: strong # Review Agent Loop 与全书冲突仲裁使用的模型档位\n review_agent_max_evidence_rounds: 2 # 最多两轮选择性取证,之后必须给出最终裁决\n review_conflict_arbitration: true # 全部审校块完成后,对互相矛盾的统一建议再做终局仲裁\n review_fix_loop: true # 只在内存影子译文上暂改并盲复审,不写回正式正文\n review_fix_max_rounds: 2 # 最多生成两轮临时替换;完整 Review 轮数另受连续 clean 确认影响\n review_clean_confirmations: 2 # 连续两轮未发现问题才视为影子译文通过\n glossary_scope: chapter # chapter=只注入本章出现的词条(长书省 token);full=全量表\n\n# ── 敬称策略(日语源文本时生效,其它语言通常不会用到)────────────────────\nhonorific:\n # keep_style: 体现语气(前辈/小X/X君…); normalize: 按统一规则;drop: 省略\n strategy: keep_style\n\n# ── 标点规范化(统一为简体中文大陆通用全角标点)────────────────────────────\npunctuation:\n normalize: true\n\n# ── 路径 ─────────────────────────────────────────────────────────────────\npaths:\n state_dir: state # 运行状态、各章中间产物、术语库\n\n# ── 双语输出 ───────────────────────────────────────────────────────────────\noutput:\n mono: true # 产出单语中文版\n bilingual: false # 产出双语版(原文淡化,与译文对照)\n bilingual_order: target_first # target_first=译文在上原文在下; source_first=原文在上\n bilingual_preserve_source_style: false # true=原文继承原书样式;false=灰色淡化显示\n about_page: true # 在书末附加“关于此翻译”说明页\n"}, "d9db1e20aa44f0944c8ee4e3af3c2efc89ab4938": {"t": 1785748681.1517932, "n": 2730, "h": "4f90dbad24609698", "c": "# trans-novel 配置(多语言小说 → 中文)\n# 修改后无需改代码;模型提供商、流水线和输出开关都在这里。\n\nlanguage:\n source: auto # auto 由模型识别来源语言;也可写死 ja / en / ko / ru / de 等语言代码\n target: zh # 译文语言\n\n# ── LLM ──────────────────────────────────────────────────────────────────\nllm:\n # deepseek | openai | openrouter | openai-compatible | ollama | vllm | fake\n provider: deepseek\n base_url: https://api.deepseek.com\n api_key_env: DEEPSEEK_API_KEY\n timeout: 600\n max_retries: 4\n tiers:\n strong:\n model: deepseek-v4-pro\n options:\n thinking: true\n reasoning_effort: high\n cheap:\n model: deepseek-v4-flash\n options:\n thinking: true\n reasoning_effort: high\n fast:\n model: deepseek-v4-flash\n options:\n thinking: true\n\n# ── 切分 ─────────────────────────────────────────────────────────────────\nsegment:\n # 一个翻译批次(句群)的目标大小,按字符粗略估算 token。\n max_chars_per_batch: 1800\n # 单个段落超过该长度时按句末标点再切成多段(续段回填时并回同段),避免超长段。\n max_chars_per_segment: 1200\n\n# ── 流水线开关(质量/成本平衡)───────────────────────────────────────────\npipeline:\n review: false # 默认关闭;开启后在全书翻译完成后自动执行最终审校\n align_retry_limit: 2\n polish: true # 润色(强档):等于用 pro 把全书再翻一遍,最烧钱;默认开\n backtranslate_sample: 0 # 回译抽检比例(0 关闭)\n consistency_qa: false # 全书跨章一致性收尾扫描\n rolling_context_segments: 6 # 注入的前文译文尾段数\n book_understanding:\n true # 翻译前预扫源文,生成全书概览+逐章梗概注入翻译(让译者对全书有理解);\n # fast 档免思考,全书概览为恒定前缀可命中缓存复用;关掉省去预扫成本\n prescan_concurrency: 4 # 预扫逐章梗概的并发线程数(各章独立,1=串行)\n review_concurrency: 4 # 最终审校连续分块的并发数(只读最终译文/术语快照,1=串行)\n review_output_retries: 2 # 单段审校输出畸形时额外重试次数(初次+2=最多 3 次)\n review_agent_loop: true # 初审发现候选后,使用强档按需取证并复核\n review_agent_tier: strong # Review Agent Loop 与全书冲突仲裁使用的模型档位\n review_agent_max_evidence_rounds: 2 # 最多两轮选择性取证,之后必须给出最终裁决\n review_conflict_arbitration: true # 全部审校块完成后,对互相矛盾的统一建议再做终局仲裁\n review_fix_loop: true # 只在内存影子译文上暂改并盲复审,不写回正式正文\n review_fix_max_rounds: 2 # 最多生成两轮临时替换;完整 Review 轮数另受连续 clean 确认影响\n review_clean_confirmations: 2 # 连续两轮未发现问题才视为影子译文通过\n glossary_scope: chapter # chapter=只注入本章出现的词条(长书省 token);full=全量表\n\n# ── 敬称策略(日语源文本时生效,其它语言通常不会用到)────────────────────\nhonorific:\n # keep_style: 体现语气(前辈/小X/X君…); normalize: 按统一规则;drop: 省略\n strategy: keep_style\n\n# ── 标点规范化(统一为简体中文大陆通用全角标点)────────────────────────────\npunctuation:\n normalize: true\n\n# ── 路径 ─────────────────────────────────────────────────────────────────\npaths:\n state_dir: state # 运行状态、各章中间产物、术语库\n\n# ── 双语输出 ───────────────────────────────────────────────────────────────\noutput:\n mono: true # 产出单语中文版\n bilingual: false # 产出双语版(原文淡化,与译文对照)\n bilingual_order: target_first # target_first=译文在上原文在下; source_first=原文在上\n bilingual_preserve_source_style: false # true=原文继承原书样式;false=灰色淡化显示\n about_page: true # 在书末附加“关于此翻译”说明页\n"}, "86d6d0b17b27658a024b11b5ddf8a32a3c308729": {"t": 1785748682.225711, "n": 2735, "h": "5d83f45d1bf7011d", "c": "# trans-novel 配置(多语言小说 → 中文)\n# 修改后无需改代码;模型提供商、流水线和输出开关都在这里。\n\nlanguage:\n source: auto # auto 由模型识别来源语言;也可写死 ja / en / ko / ru / de 等语言代码\n target: zh # 译文语言\n\n# ── LLM ──────────────────────────────────────────────────────────────────\nllm:\n # deepseek | openai | openrouter | openai-compatible | ollama | vllm | fake\n provider: deepseek\n base_url: https://api.deepseek.com\n api_key_env: DEEPSEEK_API_KEY\n timeout: 600\n max_retries: 4\n tiers:\n strong:\n model: deepseek-v4-pro\n options:\n thinking: true\n reasoning_effort: high\n cheap:\n model: deepseek-v4-flash\n options:\n thinking: true\n reasoning_effort: high\n fast:\n model: deepseek-v4-flash\n options:\n thinking: true\n\n# ── 切分 ─────────────────────────────────────────────────────────────────\nsegment:\n # 一个翻译批次(句群)的目标大小,按字符粗略估算 token。\n max_chars_per_batch: 1800\n # 单个段落超过该长度时按句末标点再切成多段(续段回填时并回同段),避免超长段。\n max_chars_per_segment: 1200\n\n# ── 流水线开关(质量/成本平衡)───────────────────────────────────────────\npipeline:\n review: false # 默认关闭;开启后在全书翻译完成后自动执行最终审校\n align_retry_limit: 2\n polish: true # 润色(强档):等于用 pro 把全书再翻一遍,最烧钱;默认开\n backtranslate_sample: 0 # 回译抽检比例(0 关闭)\n consistency_qa: false # 全书跨章一致性收尾扫描\n rolling_context_segments: 6 # 注入的前文译文尾段数\n book_understanding:\n true # 翻译前预扫源文,生成全书概览+逐章梗概注入翻译(让译者对全书有理解);\n # fast 档免思考,全书概览为恒定前缀可命中缓存复用;关掉省去预扫成本\n prescan_concurrency: 4 # 预扫逐章梗概的并发线程数(各章独立,1=串行)\n review_concurrency: 4 # 最终审校连续分块的并发数(只读最终译文/术语快照,1=串行)\n review_output_retries: 2 # 单段审校输出畸形时额外重试次数(初次+2=最多 3 次)\n review_agent_loop: true # 初审发现候选后,使用强档按需取证并复核\n review_agent_tier: strong # Review Agent Loop 与全书冲突仲裁使用的模型档位\n review_agent_max_evidence_rounds: 2 # 最多两轮选择性取证,之后必须给出最终裁决\n review_conflict_arbitration: true # 全部审校块完成后,对互相矛盾的统一建议再做终局仲裁\n review_fix_loop: true # 只在 Debug 影子译文上暂改并盲复审,不写回正式正文\n review_fix_max_rounds: 2 # 最多生成两轮临时替换;完整 Review 轮数另受连续 clean 确认影响\n review_clean_confirmations: 2 # 连续两轮未发现问题才视为影子译文通过\n glossary_scope: chapter # chapter=只注入本章出现的词条(长书省 token);full=全量表\n\n# ── 敬称策略(日语源文本时生效,其它语言通常不会用到)────────────────────\nhonorific:\n # keep_style: 体现语气(前辈/小X/X君…); normalize: 按统一规则;drop: 省略\n strategy: keep_style\n\n# ── 标点规范化(统一为简体中文大陆通用全角标点)────────────────────────────\npunctuation:\n normalize: true\n\n# ── 路径 ─────────────────────────────────────────────────────────────────\npaths:\n state_dir: state # 运行状态、各章中间产物、术语库\n\n# ── 双语输出 ───────────────────────────────────────────────────────────────\noutput:\n mono: true # 产出单语中文版\n bilingual: false # 产出双语版(原文淡化,与译文对照)\n bilingual_order: target_first # target_first=译文在上原文在下; source_first=原文在上\n bilingual_preserve_source_style: false # true=原文继承原书样式;false=灰色淡化显示\n about_page: true # 在书末附加“关于此翻译”说明页\n"}, "d474cc814b8e3c4806bc9f64f37d37473e5fae11": {"t": 1785748683.485267, "n": 2559, "h": "016bfc048df6292a", "c": "# trans-novel 配置(多语言小说 → 中文)\n# 修改后无需改代码;模型提供商、流水线和输出开关都在这里。\n\nlanguage:\n source: auto # auto 由模型识别来源语言;也可写死 ja / en / ko / ru / de 等语言代码\n target: zh # 译文语言\n\n# ── LLM ──────────────────────────────────────────────────────────────────\nllm:\n # deepseek | openai | openrouter | openai-compatible | ollama | vllm | fake\n provider: deepseek\n base_url: https://api.deepseek.com\n api_key_env: DEEPSEEK_API_KEY\n timeout: 600\n max_retries: 4\n tiers:\n strong:\n model: deepseek-v4-pro\n options:\n thinking: true\n reasoning_effort: high\n cheap:\n model: deepseek-v4-flash\n options:\n thinking: true\n reasoning_effort: high\n fast:\n model: deepseek-v4-flash\n options:\n thinking: true\n\n# ── 切分 ─────────────────────────────────────────────────────────────────\nsegment:\n # 一个翻译批次(句群)的目标大小,按字符粗略估算 token。\n max_chars_per_batch: 1800\n # 单个段落超过该长度时按句末标点再切成多段(续段回填时并回同段),避免超长段。\n max_chars_per_segment: 1200\n\n# ── 流水线开关(质量/成本平衡)───────────────────────────────────────────\npipeline:\n review: false # 默认关闭;开启后在全书翻译完成后自动执行最终审校\n align_retry_limit: 2\n polish: true # 润色(强档):等于用 pro 把全书再翻一遍,最烧钱;默认开\n backtranslate_sample: 0 # 回译抽检比例(0 关闭)\n consistency_qa: false # 全书跨章一致性收尾扫描\n rolling_context_segments: 6 # 注入的前文译文尾段数\n book_understanding:\n true # 翻译前预扫源文,生成全书概览+逐章梗概注入翻译(让译者对全书有理解);\n # fast 档免思考,全书概览为恒定前缀可命中缓存复用;关掉省去预扫成本\n prescan_concurrency: 4 # 预扫逐章梗概的并发线程数(各章独立,1=串行)\n review_concurrency: 4 # 最终审校连续分块的并发数(只读最终译文/术语快照,1=串行)\n review_output_retries: 2 # 单段审校输出畸形时额外重试次数(初次+2=最多 3 次)\n review_agent_loop: true # 初审发现候选后,使用强档按需取证并复核\n review_agent_tier: strong # Review Agent Loop 与全书冲突仲裁使用的模型档位\n review_agent_max_evidence_rounds: 2 # 最多两轮选择性取证,之后必须给出最终裁决\n review_conflict_arbitration: true # 全部审校块完成后,对互相矛盾的统一建议再做终局仲裁\n glossary_scope: chapter # chapter=只注入本章出现的词条(长书省 token);full=全量表\n\n# ── 敬称策略(日语源文本时生效,其它语言通常不会用到)────────────────────\nhonorific:\n # keep_style: 体现语气(前辈/小X/X君…); normalize: 按统一规则;drop: 省略\n strategy: keep_style\n\n# ── 标点规范化(统一为简体中文大陆通用全角标点)────────────────────────────\npunctuation:\n normalize: true\n\n# ── 路径 ─────────────────────────────────────────────────────────────────\npaths:\n state_dir: state # 运行状态、各章中间产物、术语库\n\n# ── 双语输出 ───────────────────────────────────────────────────────────────\noutput:\n mono: true # 产出单语中文版\n bilingual: false # 产出双语版(原文淡化,与译文对照)\n bilingual_order: target_first # target_first=译文在上原文在下; source_first=原文在上\n bilingual_preserve_source_style: false # true=原文继承原书样式;false=灰色淡化显示\n about_page: true # 在书末附加“关于此翻译”说明页\n"}, "f83ec7df1cb0640b62d618cd34d18d84274ccaaf": {"t": 1785748684.7189348, "n": 2375, "h": "da4f1010b3277bc3", "c": "# trans-novel 配置(多语言小说 → 中文)\n# 修改后无需改代码;模型提供商、流水线和输出开关都在这里。\n\nlanguage:\n source: auto # auto 由模型识别来源语言;也可写死 ja / en / ko / ru / de 等语言代码\n target: zh # 译文语言\n\n# ── LLM ──────────────────────────────────────────────────────────────────\nllm:\n # deepseek | openai | openrouter | openai-compatible | ollama | vllm | fake\n provider: deepseek\n base_url: https://api.deepseek.com\n api_key_env: DEEPSEEK_API_KEY\n timeout: 600\n max_retries: 4\n tiers:\n strong:\n model: deepseek-v4-pro\n options:\n thinking: true\n reasoning_effort: high\n cheap:\n model: deepseek-v4-flash\n options:\n thinking: true\n reasoning_effort: high\n fast:\n model: deepseek-v4-flash\n options:\n thinking: true\n\n# ── 切分 ─────────────────────────────────────────────────────────────────\nsegment:\n # 一个翻译批次(句群)的目标大小,按字符粗略估算 token。\n max_chars_per_batch: 1800\n # 单个段落超过该长度时按句末标点再切成多段(续段回填时并回同段),避免超长段。\n max_chars_per_segment: 1200\n\n# ── 流水线开关(质量/成本平衡)───────────────────────────────────────────\npipeline:\n review: false # 默认关闭;开启后在全书翻译完成后自动执行最终审校\n autofix_severe: false # 最终审校后自动重译严重项(漏译/误译);关掉仅上报\n align_retry_limit: 2\n polish: true # 润色(强档):等于用 pro 把全书再翻一遍,最烧钱;默认开\n backtranslate_sample: 0 # 回译抽检比例(0 关闭)\n consistency_qa: false # 全书跨章一致性收尾扫描\n rolling_context_segments: 6 # 注入的前文译文尾段数\n book_understanding:\n true # 翻译前预扫源文,生成全书概览+逐章梗概注入翻译(让译者对全书有理解);\n # fast 档免思考,全书概览为恒定前缀可命中缓存复用;关掉省去预扫成本\n prescan_concurrency: 4 # 预扫逐章梗概的并发线程数(各章独立,1=串行)\n review_concurrency: 4 # 最终审校连续分块的并发数(只读最终译文/术语快照,1=串行)\n review_output_retries: 2 # 单段审校输出畸形时额外重试次数(初次+2=最多 3 次)\n glossary_scope: chapter # chapter=只注入本章出现的词条(长书省 token);full=全量表\n\n# ── 敬称策略(日语源文本时生效,其它语言通常不会用到)────────────────────\nhonorific:\n # keep_style: 体现语气(前辈/小X/X君…); normalize: 按统一规则;drop: 省略\n strategy: keep_style\n\n# ── 标点规范化(统一为简体中文大陆通用全角标点)────────────────────────────\npunctuation:\n normalize: true\n\n# ── 路径 ─────────────────────────────────────────────────────────────────\npaths:\n state_dir: state # 运行状态、各章中间产物、术语库\n\n# ── 双语输出 ───────────────────────────────────────────────────────────────\noutput:\n mono: true # 产出单语中文版\n bilingual: false # 产出双语版(原文淡化,与译文对照)\n bilingual_order: target_first # target_first=译文在上原文在下; source_first=原文在上\n bilingual_preserve_source_style: false # true=原文继承原书样式;false=灰色淡化显示\n about_page: true # 在书末附加“关于此翻译”说明页\n"}, "5b46974c9846647fe87ee8617ae063633dbd5ec4": {"t": 1785748685.9627962, "n": 2317, "h": "aac5a11f435b7212", "c": "# trans-novel 配置(多语言小说 → 中文)\n# 修改后无需改代码;模型提供商、流水线和输出开关都在这里。\n\nlanguage:\n source: auto # auto 由模型识别来源语言;也可写死 ja / en / ko / ru / de 等语言代码\n target: zh # 译文语言\n\n# ── LLM ──────────────────────────────────────────────────────────────────\nllm:\n # deepseek | openai | openrouter | openai-compatible | ollama | vllm | fake\n provider: deepseek\n base_url: https://api.deepseek.com\n api_key_env: DEEPSEEK_API_KEY\n timeout: 600\n max_retries: 4\n tiers:\n strong:\n model: deepseek-v4-pro\n options:\n thinking: true\n reasoning_effort: high\n cheap:\n model: deepseek-v4-flash\n options:\n thinking: true\n reasoning_effort: high\n fast:\n model: deepseek-v4-flash\n options:\n thinking: true\n\n# ── 切分 ─────────────────────────────────────────────────────────────────\nsegment:\n # 一个翻译批次(句群)的目标大小,按字符粗略估算 token。\n max_chars_per_batch: 1800\n # 单个段落超过该长度时按句末标点再切成多段(续段回填时并回同段),避免超长段。\n max_chars_per_segment: 1200\n\n# ── 流水线开关(质量/成本平衡)───────────────────────────────────────────\npipeline:\n review: false # 默认关闭;开启后在全书翻译完成后自动执行最终审校\n autofix_severe: false # 最终审校后自动重译严重项(漏译/误译);关掉仅上报\n align_retry_limit: 2\n polish: true # 润色(强档):等于用 pro 把全书再翻一遍,最烧钱;默认开\n backtranslate_sample: 0 # 回译抽检比例(0 关闭)\n consistency_qa: false # 全书跨章一致性收尾扫描\n rolling_context_segments: 6 # 注入的前文译文尾段数\n book_understanding:\n true # 翻译前预扫源文,生成全书概览+逐章梗概注入翻译(让译者对全书有理解);\n # fast 档免思考,全书概览为恒定前缀可命中缓存复用;关掉省去预扫成本\n prescan_concurrency: 4 # 预扫逐章梗概的并发线程数(各章独立,1=串行)\n review_concurrency: 4 # 最终审校连续分块的并发数(只读最终译文/术语快照,1=串行)\n glossary_scope: chapter # chapter=只注入本章出现的词条(长书省 token);full=全量表\n\n# ── 敬称策略(日语源文本时生效,其它语言通常不会用到)────────────────────\nhonorific:\n # keep_style: 体现语气(前辈/小X/X君…); normalize: 按统一规则;drop: 省略\n strategy: keep_style\n\n# ── 标点规范化(统一为简体中文大陆通用全角标点)────────────────────────────\npunctuation:\n normalize: true\n\n# ── 路径 ─────────────────────────────────────────────────────────────────\npaths:\n state_dir: state # 运行状态、各章中间产物、术语库\n\n# ── 双语输出 ───────────────────────────────────────────────────────────────\noutput:\n mono: true # 产出单语中文版\n bilingual: false # 产出双语版(原文淡化,与译文对照)\n bilingual_order: target_first # target_first=译文在上原文在下; source_first=原文在上\n bilingual_preserve_source_style: false # true=原文继承原书样式;false=灰色淡化显示\n about_page: true # 在书末附加“关于此翻译”说明页\n"}, "3ae293f11635c416b5397d9401b4845d1e63ab5f": {"t": 1785748687.052788, "n": 2247, "h": "06181761e66b4718", "c": "# trans-novel 配置(多语言小说 → 中文)\n# 修改后无需改代码;模型提供商、流水线和输出开关都在这里。\n\nlanguage:\n source: auto # auto 由模型识别来源语言;也可写死 ja / en / ko / ru / de 等语言代码\n target: zh # 译文语言\n\n# ── LLM ──────────────────────────────────────────────────────────────────\nllm:\n # deepseek | openai | openrouter | openai-compatible | ollama | vllm | fake\n provider: deepseek\n base_url: https://api.deepseek.com\n api_key_env: DEEPSEEK_API_KEY\n timeout: 600\n max_retries: 4\n tiers:\n strong:\n model: deepseek-v4-pro\n options:\n thinking: true\n reasoning_effort: high\n cheap:\n model: deepseek-v4-flash\n options:\n thinking: true\n reasoning_effort: high\n fast:\n model: deepseek-v4-flash\n options:\n thinking: true\n\n# ── 切分 ─────────────────────────────────────────────────────────────────\nsegment:\n # 一个翻译批次(句群)的目标大小,按字符粗略估算 token。\n max_chars_per_batch: 1800\n # 单个段落超过该长度时按句末标点再切成多段(续段回填时并回同段),避免超长段。\n max_chars_per_segment: 1200\n\n# ── 流水线开关(质量/成本平衡)───────────────────────────────────────────\npipeline:\n review: false # 默认关闭;开启后在全书翻译完成后自动执行最终审校\n autofix_severe: false # 最终审校后自动重译严重项(漏译/误译);关掉仅上报\n align_retry_limit: 2\n polish: true # 润色(强档):等于用 pro 把全书再翻一遍,最烧钱;默认开\n backtranslate_sample: 0 # 回译抽检比例(0 关闭)\n consistency_qa: false # 全书跨章一致性收尾扫描\n rolling_context_segments: 6 # 注入的前文译文尾段数\n book_understanding:\n true # 翻译前预扫源文,生成全书概览+逐章梗概注入翻译(让译者对全书有理解);\n # fast 档免思考,全书概览为恒定前缀可命中缓存复用;关掉省去预扫成本\n prescan_concurrency: 4 # 预扫逐章梗概的并发线程数(各章独立,1=串行)\n review_concurrency: 4 # 最终审校连续分块的并发数(只读最终译文/术语快照,1=串行)\n glossary_scope: chapter # chapter=只注入本章出现的词条(长书省 token);full=全量表\n\n# ── 敬称策略(日语源文本时生效,其它语言通常不会用到)────────────────────\nhonorific:\n # keep_style: 体现语气(前辈/小X/X君…); normalize: 按统一规则;drop: 省略\n strategy: keep_style\n\n# ── 标点规范化(统一为简体中文大陆通用全角标点)────────────────────────────\npunctuation:\n normalize: true\n\n# ── 路径 ─────────────────────────────────────────────────────────────────\npaths:\n state_dir: state # 运行状态、各章中间产物、术语库\n\n# ── 双语输出 ───────────────────────────────────────────────────────────────\noutput:\n mono: true # 产出单语中文版\n bilingual: false # 产出双语版(原文淡化,与译文对照)\n bilingual_order: target_first # target_first=译文在上原文在下; source_first=原文在上\n about_page: true # 在书末附加“关于此翻译”说明页\n"}, "8fa68b241226fe0d2c5dc4aca4fc42bf34cb751f": {"t": 1785748688.2618408, "n": 2250, "h": "c8a4f1cf33cef535", "c": "# trans-novel 配置(多语言小说 → 中文)\n# 修改后无需改代码;模型提供商、流水线和输出开关都在这里。\n\nlanguage:\n source: auto # auto 由模型识别来源语言;也可写死 ja / en / ko / ru / de 等语言代码\n target: zh # 译文语言\n\n# ── LLM ──────────────────────────────────────────────────────────────────\nllm:\n # deepseek | openai | openrouter | openai-compatible | ollama | vllm | fake\n provider: deepseek\n base_url: https://api.deepseek.com\n api_key_env: DEEPSEEK_API_KEY\n timeout: 600\n max_retries: 4\n tiers:\n strong:\n model: deepseek-v4-pro\n options:\n thinking: true\n reasoning_effort: high\n cheap:\n model: deepseek-v4-flash\n options:\n thinking: true\n reasoning_effort: high\n fast:\n model: deepseek-v4-flash\n options:\n thinking: true\n\n# ── 切分 ─────────────────────────────────────────────────────────────────\nsegment:\n # 一个翻译批次(句群)的目标大小,按字符粗略估算 token。\n max_chars_per_batch: 1800\n # 单个段落超过该长度时按句末标点再切成多段(续段回填时并回同段),避免超长段。\n max_chars_per_segment: 1200\n\n# ── 流水线开关(质量/成本平衡)───────────────────────────────────────────\npipeline:\n review: true # 全书翻译完成后自动执行最终审校(漏译/误译/术语/人称)\n autofix_severe: false # 最终审校后自动重译严重项(漏译/误译);关掉仅上报\n align_retry_limit: 2\n polish: true # 润色(强档):等于用 pro 把全书再翻一遍,最烧钱;默认开\n backtranslate_sample: 0 # 回译抽检比例(0 关闭)\n consistency_qa: false # 全书跨章一致性收尾扫描\n rolling_context_segments: 6 # 注入的前文译文尾段数\n book_understanding:\n true # 翻译前预扫源文,生成全书概览+逐章梗概注入翻译(让译者对全书有理解);\n # fast 档免思考,全书概览为恒定前缀可命中缓存复用;关掉省去预扫成本\n prescan_concurrency: 4 # 预扫逐章梗概的并发线程数(各章独立,1=串行)\n review_concurrency: 4 # 最终审校连续分块的并发数(只读最终译文/术语快照,1=串行)\n glossary_scope: chapter # chapter=只注入本章出现的词条(长书省 token);full=全量表\n\n# ── 敬称策略(日语源文本时生效,其它语言通常不会用到)────────────────────\nhonorific:\n # keep_style: 体现语气(前辈/小X/X君…); normalize: 按统一规则;drop: 省略\n strategy: keep_style\n\n# ── 标点规范化(统一为简体中文大陆通用全角标点)────────────────────────────\npunctuation:\n normalize: true\n\n# ── 路径 ─────────────────────────────────────────────────────────────────\npaths:\n state_dir: state # 运行状态、各章中间产物、术语库\n\n# ── 双语输出 ───────────────────────────────────────────────────────────────\noutput:\n mono: true # 产出单语中文版\n bilingual: false # 产出双语版(原文淡化,与译文对照)\n bilingual_order: target_first # target_first=译文在上原文在下; source_first=原文在上\n about_page: true # 在书末附加“关于此翻译”说明页\n"}, "fdaa1a0ddabf4bc3839c69e6aa8146f5b847dbfd": {"t": 1785748689.346547, "n": 2248, "h": "0cac565e1cc0529f", "c": "# trans-novel 配置(多语言小说 → 中文)\n# 修改后无需改代码;模型提供商、流水线和输出开关都在这里。\n\nlanguage:\n source: auto # auto 由模型识别来源语言;也可写死 ja / en / ko / ru / de 等语言代码\n target: zh # 译文语言\n\n# ── LLM ──────────────────────────────────────────────────────────────────\nllm:\n # deepseek | openai | openrouter | openai-compatible | ollama | vllm | fake\n provider: deepseek\n base_url: https://api.deepseek.com\n api_key_env: DEEPSEEK_API_KEY\n timeout: 600\n max_retries: 4\n tiers:\n strong:\n model: deepseek-v4-pro\n options:\n thinking: true\n reasoning_effort: high\n cheap:\n model: deepseek-v4-flash\n options:\n thinking: true\n reasoning_effort: high\n fast:\n model: deepseek-v4-flash\n options:\n thinking: true\n\n# ── 切分 ─────────────────────────────────────────────────────────────────\nsegment:\n # 一个翻译批次(句群)的目标大小,按字符粗略估算 token。\n max_chars_per_batch: 1800\n # 单个段落超过该长度时按句末标点再切成多段(续段回填时并回同段),避免超长段。\n max_chars_per_segment: 1200\n\n# ── 流水线开关(质量/成本平衡)───────────────────────────────────────────\npipeline:\n review: true # 章末整章审校(廉价档):漏译/误译/术语/人称检查\n autofix_severe: false # 审校后自动重译严重项(漏译/误译);关掉仅上报,不改正文\n align_retry_limit: 2\n polish: true # 润色(强档):等于用 pro 把全书再翻一遍,最烧钱;默认开\n backtranslate_sample: 0 # 回译抽检比例(0 关闭)\n consistency_qa: false # 全书跨章一致性收尾扫描\n rolling_context_segments: 6 # 注入的前文译文尾段数\n book_understanding:\n true # 翻译前预扫源文,生成全书概览+逐章梗概注入翻译(让译者对全书有理解);\n # fast 档免思考,全书概览为恒定前缀可命中缓存复用;关掉省去预扫成本\n prescan_concurrency: 4 # 预扫逐章梗概的并发线程数(各章独立,1=串行)\n review_concurrency: 4 # 章末审校分块的并发线程数(只读固定译文/术语,1=串行)\n glossary_scope: chapter # chapter=只注入本章出现的词条(长书省 token);full=全量表\n\n# ── 敬称策略(日语源文本时生效,其它语言通常不会用到)────────────────────\nhonorific:\n # keep_style: 体现语气(前辈/小X/X君…); normalize: 按统一规则;drop: 省略\n strategy: keep_style\n\n# ── 标点规范化(统一为简体中文大陆通用全角标点)────────────────────────────\npunctuation:\n normalize: true\n\n# ── 路径 ─────────────────────────────────────────────────────────────────\npaths:\n state_dir: state # 运行状态、各章中间产物、术语库\n\n# ── 双语输出 ───────────────────────────────────────────────────────────────\noutput:\n mono: true # 产出单语中文版\n bilingual: false # 产出双语版(原文淡化,与译文对照)\n bilingual_order: target_first # target_first=译文在上原文在下; source_first=原文在上\n about_page: true # 在书末附加“关于此翻译”说明页\n"}, "f8ef812ff8559e8f24d0052131537c9499287fed": {"t": 1785748690.4281144, "n": 2253, "h": "c06fbe988c9ba886", "c": "# trans-novel 配置(多语言小说 → 中文)\n# 修改后无需改代码;模型提供商、流水线和输出开关都在这里。\n\nlanguage:\n source: auto # auto 由模型识别来源语言;也可写死 ja / en / ko / ru / de 等语言代码\n target: zh # 译文语言\n\n# ── LLM ──────────────────────────────────────────────────────────────────\nllm:\n # deepseek | openai | openrouter | openai-compatible | ollama | vllm | fake\n provider: deepseek\n base_url: https://api.deepseek.com\n api_key_env: DEEPSEEK_API_KEY\n timeout: 600\n max_retries: 4\n tiers:\n strong:\n model: deepseek-v4-pro\n options:\n thinking: true\n reasoning_effort: high\n cheap:\n model: deepseek-v4-flash\n options:\n thinking: true\n reasoning_effort: high\n fast:\n model: deepseek-v4-flash\n options:\n thinking: true\n\n# ── 切分 ─────────────────────────────────────────────────────────────────\nsegment:\n # 一个翻译批次(句群)的目标大小,按字符粗略估算 token。\n max_chars_per_batch: 1800\n # 单个段落超过该长度时按句末标点再切成多段(续段回填时并回同段),避免超长段。\n max_chars_per_segment: 1200\n\n# ── 流水线开关(质量/成本平衡)───────────────────────────────────────────\npipeline:\n review: true # 章末整章审校(廉价档):漏译/误译/术语/人称检查\n autofix_severe: false # 审校后自动重译严重项(漏译/误译);关掉仅上报,不改正文\n align_retry_limit: 2\n polish: true # 润色(强档):等于用 pro 把全书再翻一遍,最烧钱;默认开\n backtranslate_sample: 0 # 回译抽检比例(0 关闭)\n consistency_qa: false # 全书跨章一致性收尾扫描\n rolling_context_segments: 6 # 注入的前文译文尾段数\n book_understanding:\n true # 翻译前预扫源文,生成全书概览+逐章梗概注入翻译(让译者对全书有理解);\n # fast 档免思考,全书概览为恒定前缀可命中缓存复用;关掉省去预扫成本\n prescan_concurrency: 4 # 预扫逐章梗概的并发线程数(各章独立,1=串行)\n review_concurrency: 4 # 章末审校分块的并发线程数(只读固定译文/术语,1=串行)\n glossary_scope: chapter # chapter=只注入本章出现的词条+锁定人物(长书省 token);full=全量表\n\n# ── 敬称策略(日语源文本时生效,其它语言通常不会用到)────────────────────\nhonorific:\n # keep_style: 体现语气(前辈/小X/X君…); normalize: 按统一规则;drop: 省略\n strategy: keep_style\n\n# ── 标点规范化(统一为简体中文大陆通用全角标点)────────────────────────────\npunctuation:\n normalize: true\n\n# ── 路径 ─────────────────────────────────────────────────────────────────\npaths:\n state_dir: state # 运行状态、各章中间产物、术语库\n\n# ── 双语输出 ───────────────────────────────────────────────────────────────\noutput:\n mono: true # 产出单语中文版\n bilingual: false # 产出双语版(原文淡化,与译文对照)\n bilingual_order: target_first # target_first=译文在上原文在下; source_first=原文在上\n about_page: true # 在书末附加“关于此翻译”说明页\n"}, "174e0a116033048bd6b35da1c179fa769ee3cd26": {"t": 1785748691.4777792, "n": 1952, "h": "844215550c1c752f", "c": "# trans-novel 配置(多语言小说 → 中文)\n# 修改后无需改代码;模型提供商、流水线和输出开关都在这里。\n\nlanguage:\n source: auto # auto 由模型识别来源语言;也可写死 ja / en / ko / ru / de 等语言代码\n target: zh # 译文语言\n\n# ── LLM ──────────────────────────────────────────────────────────────────\nllm:\n # deepseek | openai | openrouter | openai-compatible | ollama | vllm | fake\n provider: deepseek\n # DeepSeek 的 base_url、API Key 环境变量和默认模型档位由 provider 内置。\n # 需要代理、自定义模型或超时时,再按 docs/configuration.md 添加覆盖项。\n\n# ── 切分 ─────────────────────────────────────────────────────────────────\nsegment:\n # 一个翻译批次(句群)的目标大小,按字符粗略估算 token。\n max_chars_per_batch: 1800\n # 单个段落超过该长度时按句末标点再切成多段(续段回填时并回同段),避免超长段。\n max_chars_per_segment: 1200\n\n# ── 流水线开关(质量/成本平衡)───────────────────────────────────────────\npipeline:\n review: true # 章末整章审校(廉价档):漏译/误译/术语/人称检查\n autofix_severe: false # 审校后自动重译严重项(漏译/误译);关掉仅上报,不改正文\n align_retry_limit: 2\n polish: true # 润色(强档):等于用 pro 把全书再翻一遍,最烧钱;默认开\n backtranslate_sample: 0 # 回译抽检比例(0 关闭)\n consistency_qa: false # 全书跨章一致性收尾扫描\n rolling_context_segments: 6 # 注入的前文译文尾段数\n book_understanding:\n true # 翻译前预扫源文,生成全书概览+逐章梗概注入翻译(让译者对全书有理解);\n # fast 档免思考,全书概览为恒定前缀可命中缓存复用;关掉省去预扫成本\n prescan_concurrency: 4 # 预扫逐章梗概的并发线程数(各章独立,1=串行)\n review_concurrency: 4 # 章末审校分块的并发线程数(只读固定译文/术语,1=串行)\n glossary_scope: chapter # chapter=只注入本章出现的词条+锁定人物(长书省 token);full=全量表\n\n# ── 敬称策略(日语源文本时生效,其它语言通常不会用到)────────────────────\nhonorific:\n # keep_style: 体现语气(前辈/小X/X君…); normalize: 按统一规则;drop: 省略\n strategy: keep_style\n\n# ── 标点规范化(统一为简体中文大陆通用全角标点)────────────────────────────\npunctuation:\n normalize: true\n\n# ── 路径 ─────────────────────────────────────────────────────────────────\npaths:\n state_dir: state # 运行状态、各章中间产物、术语库\n\n# ── 双语输出 ───────────────────────────────────────────────────────────────\noutput:\n mono: true # 产出单语中文版\n bilingual: false # 产出双语版(原文淡化,与译文对照)\n bilingual_order: target_first # target_first=译文在上原文在下; source_first=原文在上\n about_page: true # 在书末附加“关于此翻译”说明页\n"}, "61b5f50cf77a3b70f77f778f326e2b564c216012": {"t": 1785748692.582106, "n": 1917, "h": "160939f90c4cf5c6", "c": "# trans-novel 配置(多语言小说 → 中文)\n# 修改后无需改代码;模型提供商、流水线和输出开关都在这里。\n\nlanguage:\n source: auto # auto 由模型识别来源语言;也可写死 ja / en / ko / ru / de 等语言代码\n target: zh # 译文语言\n\n# ── LLM ──────────────────────────────────────────────────────────────────\nllm:\n provider: deepseek # deepseek | fake(fake 用于离线测试,不发网络请求)\n # DeepSeek 的 base_url、DEEPSEEK_API_KEY 和默认模型档位由 provider 内置。\n # 需要代理、自定义模型或超时时,再按 docs/configuration.md 添加覆盖项。\n\n# ── 切分 ─────────────────────────────────────────────────────────────────\nsegment:\n # 一个翻译批次(句群)的目标大小,按字符粗略估算 token。\n max_chars_per_batch: 1800\n # 单个段落超过该长度时按句末标点再切成多段(续段回填时并回同段),避免超长段。\n max_chars_per_segment: 1200\n\n# ── 流水线开关(质量/成本平衡)───────────────────────────────────────────\npipeline:\n review: true # 章末整章审校(廉价档):漏译/误译/术语/人称检查\n autofix_severe: false # 审校后自动重译严重项(漏译/误译);关掉仅上报,不改正文\n align_retry_limit: 2\n polish: true # 润色(强档):等于用 pro 把全书再翻一遍,最烧钱;默认开\n backtranslate_sample: 0 # 回译抽检比例(0 关闭)\n consistency_qa: false # 全书跨章一致性收尾扫描\n rolling_context_segments: 6 # 注入的前文译文尾段数\n book_understanding:\n true # 翻译前预扫源文,生成全书概览+逐章梗概注入翻译(让译者对全书有理解);\n # fast 档免思考,全书概览为恒定前缀可命中缓存复用;关掉省去预扫成本\n prescan_concurrency: 4 # 预扫逐章梗概的并发线程数(各章独立,1=串行)\n review_concurrency: 4 # 章末审校分块的并发线程数(只读固定译文/术语,1=串行)\n glossary_scope: chapter # chapter=只注入本章出现的词条+锁定人物(长书省 token);full=全量表\n\n# ── 敬称策略(日语源文本时生效,其它语言通常不会用到)────────────────────\nhonorific:\n # keep_style: 体现语气(前辈/小X/X君…); normalize: 按统一规则;drop: 省略\n strategy: keep_style\n\n# ── 标点规范化(统一为简体中文大陆通用全角标点)────────────────────────────\npunctuation:\n normalize: true\n\n# ── 路径 ─────────────────────────────────────────────────────────────────\npaths:\n state_dir: state # 运行状态、各章中间产物、术语库\n\n# ── 双语输出 ───────────────────────────────────────────────────────────────\noutput:\n mono: true # 产出单语中文版\n bilingual: false # 产出双语版(原文淡化,与译文对照)\n bilingual_order: target_first # target_first=译文在上原文在下; source_first=原文在上\n about_page: true # 在书末附加“关于此翻译”说明页\n"}, "fa528e94bd71e2b90836cb65efcc4a788ee8a85c": {"t": 1785748693.715081, "n": 2413, "h": "564f541d744435e8", "c": "# trans-novel 配置(多语言小说 → 中文)\n# 修改后无需改代码;模型 ID、档位、流水线开关都在这里。\n\nlanguage:\n source: auto # auto 由模型识别来源语言;也可写死 ja / en / ko / ru / de 等语言代码\n target: zh # 译文语言\n\n# ── LLM:DeepSeek 三档(经 OpenAI SDK 调 https://api.deepseek.com)─────────\n# strong/cheap 开 thinking(求质量的判断类任务);fast 关 thinking(机械任务,\n# thinking 推理 token 按输出计费,关掉大幅省钱提速)。缺档按 fast→cheap→strong 回退。\nllm:\n provider: deepseek # deepseek | fake(fake 用于离线测试,不发网络请求)\n base_url: https://api.deepseek.com\n api_key_env: DEEPSEEK_API_KEY # 从该环境变量读取 key\n timeout: 600 # 单次请求超时(秒),思考模式耗时较长\n max_retries: 4 # 失败重试次数(指数退避)\n tiers:\n strong:\n model: deepseek-v4-pro # 翻译 / 润色 / 全局分析 / 标题\n reasoning_effort: high\n thinking: true\n cheap:\n model: deepseek-v4-flash # 审校 / 一致性 QA / 回译比对(判断类,保留思考)\n reasoning_effort: high\n thinking: true\n fast:\n model: deepseek-v4-flash # 梗概 / 全书概览 / 术语抽取 / 回译(机械任务,免思考)\n thinking: false\n\n# ── 切分 ─────────────────────────────────────────────────────────────────\nsegment:\n # 一个翻译批次(句群)的目标大小,按字符粗略估算 token。\n max_chars_per_batch: 1800\n # 单个段落超过该长度时按句末标点再切成多段(续段回填时并回同段),避免超长段。\n max_chars_per_segment: 1200\n\n# ── 流水线开关(质量/成本平衡)───────────────────────────────────────────\npipeline:\n review: true # 章末整章审校(廉价档):漏译/误译/术语/人称检查\n autofix_severe: false # 审校后自动重译严重项(漏译/误译);关掉仅上报,不改正文\n align_retry_limit: 2\n polish: true # 润色(强档):等于用 pro 把全书再翻一遍,最烧钱;默认开\n backtranslate_sample: 0 # 回译抽检比例(0 关闭)\n consistency_qa: false # 全书跨章一致性收尾扫描\n rolling_context_segments: 6 # 注入的前文译文尾段数\n book_understanding:\n true # 翻译前预扫源文,生成全书概览+逐章梗概注入翻译(让译者对全书有理解);\n # fast 档免思考,全书概览为恒定前缀可命中缓存复用;关掉省去预扫成本\n prescan_concurrency: 4 # 预扫逐章梗概的并发线程数(各章独立,1=串行)\n review_concurrency: 4 # 章末审校分块的并发线程数(只读固定译文/术语,1=串行)\n glossary_scope: chapter # chapter=只注入本章出现的词条+锁定人物(长书省 token);full=全量表\n\n# ── 敬称策略(日语源文本时生效,其它语言通常不会用到)────────────────────\nhonorific:\n # keep_style: 体现语气(前辈/小X/X君…); normalize: 按统一规则;drop: 省略\n strategy: keep_style\n\n# ── 标点规范化(统一为简体中文大陆通用全角标点)────────────────────────────\npunctuation:\n normalize: true\n\n# ── 路径 ─────────────────────────────────────────────────────────────────\npaths:\n state_dir: state # 运行状态、各章中间产物、术语库\n\n# ── 双语输出 ───────────────────────────────────────────────────────────────\noutput:\n mono: true # 产出单语中文版\n bilingual: false # 产出双语版(原文淡化,与译文对照)\n bilingual_order: target_first # target_first=译文在上原文在下; source_first=原文在上\n about_page: true # 在书末附加“关于此翻译”说明页\n"}, "767c265d63ba314393caed61fb0df42114f906c7": {"t": 1785748694.962206, "n": 2371, "h": "8c3feb302103e9cb", "c": "# trans-novel 配置(多语言小说 → 中文)\n# 修改后无需改代码;模型 ID、档位、流水线开关都在这里。\n\nlanguage:\n source: auto # auto 由模型识别来源语言;也可写死 ja / en / ko / ru / de 等语言代码\n target: zh # 译文语言\n\n# ── LLM:DeepSeek 三档(经 OpenAI SDK 调 https://api.deepseek.com)─────────\n# strong/cheap 开 thinking(求质量的判断类任务);fast 关 thinking(机械任务,\n# thinking 推理 token 按输出计费,关掉大幅省钱提速)。缺档按 fast→cheap→strong 回退。\nllm:\n provider: deepseek # deepseek | fake(fake 用于离线测试,不发网络请求)\n base_url: https://api.deepseek.com\n api_key_env: DEEPSEEK_API_KEY # 从该环境变量读取 key\n timeout: 600 # 单次请求超时(秒),思考模式耗时较长\n max_retries: 4 # 失败重试次数(指数退避)\n tiers:\n strong:\n model: deepseek-v4-pro # 翻译 / 润色 / 全局分析 / 标题\n reasoning_effort: high\n thinking: true\n cheap:\n model: deepseek-v4-flash # 审校 / 一致性 QA / 回译比对(判断类,保留思考)\n reasoning_effort: high\n thinking: true\n fast:\n model: deepseek-v4-flash # 梗概 / 全书概览 / 术语抽取 / 回译(机械任务,免思考)\n thinking: false\n\n# ── 切分 ─────────────────────────────────────────────────────────────────\nsegment:\n # 一个翻译批次(句群)的目标大小,按字符粗略估算 token。\n max_chars_per_batch: 1800\n # 单个段落超过该长度时按句末标点再切成多段(续段回填时并回同段),避免超长段。\n max_chars_per_segment: 1200\n\n# ── 流水线开关(质量/成本平衡)───────────────────────────────────────────\npipeline:\n review: true # 章末整章审校(廉价档):漏译/误译/术语/人称检查\n autofix_severe: false # 审校后自动重译严重项(漏译/误译);关掉仅上报,不改正文\n align_retry_limit: 2\n polish: true # 润色(强档):等于用 pro 把全书再翻一遍,最烧钱;默认开\n backtranslate_sample: 0 # 回译抽检比例(0 关闭)\n consistency_qa: false # 全书跨章一致性收尾扫描\n rolling_context_segments: 6 # 注入的前文译文尾段数\n book_understanding:\n true # 翻译前预扫源文,生成全书概览+逐章梗概注入翻译(让译者对全书有理解);\n # fast 档免思考,全书概览为恒定前缀可命中缓存复用;关掉省去预扫成本\n prescan_concurrency: 4 # 预扫逐章梗概的并发线程数(各章独立,1=串行)\n review_concurrency: 4 # 章末审校分块的并发线程数(只读固定译文/术语,1=串行)\n glossary_scope: chapter # chapter=只注入本章出现的词条+锁定人物(长书省 token);full=全量表\n\n# ── 敬称策略(日语源文本时生效,其它语言通常不会用到)────────────────────\nhonorific:\n # keep_style: 体现语气(前辈/小X/X君…); normalize: 按统一规则;drop: 省略\n strategy: keep_style\n\n# ── 标点规范化(统一为简体中文大陆通用全角标点)────────────────────────────\npunctuation:\n normalize: true\n\n# ── 路径 ─────────────────────────────────────────────────────────────────\npaths:\n state_dir: state # 运行状态、各章中间产物、术语库\n\n# ── 双语输出 ───────────────────────────────────────────────────────────────\noutput:\n mono: true # 产出单语中文版\n bilingual: false # 产出双语版(原文淡化,与译文对照)\n bilingual_order: target_first # target_first=译文在上原文在下; source_first=原文在上\n"}, "706b54c2b84a81a746c0932ed2757b94e83bdbf9": {"t": 1785748696.0498602, "n": 2316, "h": "60c86536b8b96b43", "c": "# trans-novel 配置(多语言小说 → 中文)\n# 修改后无需改代码;模型 ID、档位、流水线开关都在这里。\n\nlanguage:\n source: auto # auto 由模型识别来源语言;也可写死 ja / en / ko / ru / de 等语言代码\n target: zh # 译文语言\n\n# ── LLM:DeepSeek 三档(经 OpenAI SDK 调 https://api.deepseek.com)─────────\n# strong/cheap 开 thinking(求质量的判断类任务);fast 关 thinking(机械任务,\n# thinking 推理 token 按输出计费,关掉大幅省钱提速)。缺档按 fast→cheap→strong 回退。\nllm:\n provider: deepseek # deepseek | fake(fake 用于离线测试,不发网络请求)\n base_url: https://api.deepseek.com\n api_key_env: DEEPSEEK_API_KEY # 从该环境变量读取 key\n timeout: 600 # 单次请求超时(秒),思考模式耗时较长\n max_retries: 4 # 失败重试次数(指数退避)\n tiers:\n strong:\n model: deepseek-v4-pro # 翻译 / 润色 / 全局分析 / 标题\n reasoning_effort: high\n thinking: true\n cheap:\n model: deepseek-v4-flash # 审校 / 一致性 QA / 回译比对(判断类,保留思考)\n reasoning_effort: high\n thinking: true\n fast:\n model: deepseek-v4-flash # 梗概 / 全书概览 / 术语抽取 / 回译(机械任务,免思考)\n thinking: false\n\n# ── 切分 ─────────────────────────────────────────────────────────────────\nsegment:\n # 一个翻译批次(句群)的目标大小,按字符粗略估算 token。\n max_chars_per_batch: 1800\n # 单个段落超过该长度时按句末标点再切成多段(续段回填时并回同段),避免超长段。\n max_chars_per_segment: 1200\n\n# ── 流水线开关(质量/成本平衡)───────────────────────────────────────────\npipeline:\n review: true # 章末整章审校(廉价档):漏译/误译/术语/人称检查\n autofix_severe: false # 审校后自动重译严重项(漏译/误译);关掉仅上报,不改正文\n align_retry_limit: 2\n polish: true # 润色(强档):等于用 pro 把全书再翻一遍,最烧钱;默认开\n backtranslate_sample: 0 # 回译抽检比例(0 关闭)\n consistency_qa: false # 全书跨章一致性收尾扫描\n rolling_context_segments: 6 # 注入的前文译文尾段数\n book_understanding:\n true # 翻译前预扫源文,生成全书概览+逐章梗概注入翻译(让译者对全书有理解);\n # fast 档免思考,全书概览为恒定前缀可命中缓存复用;关掉省去预扫成本\n prescan_concurrency: 4 # 预扫逐章梗概的并发线程数(各章独立,1=串行)\n glossary_scope: chapter # chapter=只注入本章出现的词条+锁定人物(长书省 token);full=全量表\n\n# ── 敬称策略(日语源文本时生效,其它语言通常不会用到)────────────────────\nhonorific:\n # keep_style: 体现语气(前辈/小X/X君…); normalize: 按统一规则;drop: 省略\n strategy: keep_style\n\n# ── 标点规范化(统一为简体中文大陆通用全角标点)────────────────────────────\npunctuation:\n normalize: true\n\n# ── 路径 ─────────────────────────────────────────────────────────────────\npaths:\n state_dir: state # 运行状态、各章中间产物、术语库\n\n# ── 双语输出 ───────────────────────────────────────────────────────────────\noutput:\n mono: true # 产出单语中文版\n bilingual: false # 产出双语版(原文淡化,与译文对照)\n bilingual_order: target_first # target_first=译文在上原文在下; source_first=原文在上\n"}, "933c914fc0b58bf4a05c2fe6d91b92d00be4092f": {"t": 1785748697.279008, "n": 2316, "h": "b7885ab86d503029", "c": "# trans-novel 配置(多语言小说 → 中文)\n# 修改后无需改代码;模型 ID、档位、流水线开关都在这里。\n\nlanguage:\n source: auto # auto 由模型识别来源语言;也可写死 ja / en / ko / ru / de 等语言代码\n target: zh # 译文语言\n\n# ── LLM:DeepSeek 三档(经 OpenAI SDK 调 https://api.deepseek.com)─────────\n# strong/cheap 开 thinking(求质量的判断类任务);fast 关 thinking(机械任务,\n# thinking 推理 token 按输出计费,关掉大幅省钱提速)。缺档按 fast→cheap→strong 回退。\nllm:\n provider: deepseek # deepseek | fake(fake 用于离线测试,不发网络请求)\n base_url: https://api.deepseek.com\n api_key_env: DEEPSEEK_API_KEY # 从该环境变量读取 key\n timeout: 600 # 单次请求超时(秒),思考模式耗时较长\n max_retries: 4 # 失败重试次数(指数退避)\n tiers:\n strong:\n model: deepseek-v4-pro # 翻译 / 润色 / 全局分析 / 标题\n reasoning_effort: high\n thinking: true\n cheap:\n model: deepseek-v4-flash # 审校 / 一致性 QA / 回译比对(判断类,保留思考)\n reasoning_effort: high\n thinking: true\n fast:\n model: deepseek-v4-flash # 梗概 / 全书概览 / 术语抽取 / 回译(机械任务,免思考)\n thinking: false\n\n# ── 切分 ─────────────────────────────────────────────────────────────────\nsegment:\n # 一个翻译批次(句群)的目标大小,按字符粗略估算 token。\n max_chars_per_batch: 1800\n # 单个段落超过该长度时按句末标点再切成多段(续段回填时并回同段),避免超长段。\n max_chars_per_segment: 1200\n\n# ── 流水线开关(质量/成本平衡)───────────────────────────────────────────\npipeline:\n review: true # 章末整章审校(廉价档):漏译/误译/术语/人称检查\n autofix_severe: false # 审校后自动重译严重项(漏译/误译);关掉仅上报,不改正文\n align_retry_limit: 2\n polish: true # 润色(强档):等于用 pro 把全书再翻一遍,最烧钱;默认关\n backtranslate_sample: 0 # 回译抽检比例(0 关闭)\n consistency_qa: false # 全书跨章一致性收尾扫描\n rolling_context_segments: 6 # 注入的前文译文尾段数\n book_understanding:\n true # 翻译前预扫源文,生成全书概览+逐章梗概注入翻译(让译者对全书有理解);\n # fast 档免思考,全书概览为恒定前缀可命中缓存复用;关掉省去预扫成本\n prescan_concurrency: 4 # 预扫逐章梗概的并发线程数(各章独立,1=串行)\n glossary_scope: chapter # chapter=只注入本章出现的词条+锁定人物(长书省 token);full=全量表\n\n# ── 敬称策略(日语源文本时生效,其它语言通常不会用到)────────────────────\nhonorific:\n # keep_style: 体现语气(前辈/小X/X君…); normalize: 按统一规则;drop: 省略\n strategy: keep_style\n\n# ── 标点规范化(统一为简体中文大陆通用全角标点)────────────────────────────\npunctuation:\n normalize: true\n\n# ── 路径 ─────────────────────────────────────────────────────────────────\npaths:\n state_dir: state # 运行状态、各章中间产物、术语库\n\n# ── 双语输出 ───────────────────────────────────────────────────────────────\noutput:\n mono: true # 产出单语中文版\n bilingual: false # 产出双语版(原文淡化,与译文对照)\n bilingual_order: target_first # target_first=译文在上原文在下; source_first=原文在上\n"}, "a8abd9d5350f49d13069ecb61de0b613e411a98b": {"t": 1785748698.369007, "n": 2316, "h": "c37cb91cd1acc9c1", "c": "# trans-novel 配置(多语言小说 → 中文)\n# 修改后无需改代码;模型 ID、档位、流水线开关都在这里。\n\nlanguage:\n source: auto # auto 由模型识别来源语言;也可写死 ja / en / ko / ru / de 等语言代码\n target: zh # 译文语言\n\n# ── LLM:DeepSeek 三档(经 OpenAI SDK 调 https://api.deepseek.com)─────────\n# strong/cheap 开 thinking(求质量的判断类任务);fast 关 thinking(机械任务,\n# thinking 推理 token 按输出计费,关掉大幅省钱提速)。缺档按 fast→cheap→strong 回退。\nllm:\n provider: deepseek # deepseek | fake(fake 用于离线测试,不发网络请求)\n base_url: https://api.deepseek.com\n api_key_env: DEEPSEEK_API_KEY # 从该环境变量读取 key\n timeout: 600 # 单次请求超时(秒),思考模式耗时较长\n max_retries: 4 # 失败重试次数(指数退避)\n tiers:\n strong:\n model: deepseek-v4-pro # 翻译 / 润色 / 全局分析 / 标题\n reasoning_effort: high\n thinking: true\n cheap:\n model: deepseek-v4-flash # 审校 / 一致性 QA / 回译比对(判断类,保留思考)\n reasoning_effort: high\n thinking: true\n fast:\n model: deepseek-v4-flash # 梗概 / 全书概览 / 术语抽取 / 回译(机械任务,免思考)\n thinking: false\n\n# ── 切分 ─────────────────────────────────────────────────────────────────\nsegment:\n # 一个翻译批次(句群)的目标大小,按字符粗略估算 token。\n max_chars_per_batch: 1800\n # 单个段落超过该长度时按句末标点再切成多段(续段回填时并回同段),避免超长段。\n max_chars_per_segment: 1200\n\n# ── 流水线开关(质量/成本平衡)───────────────────────────────────────────\npipeline:\n review: true # 章末整章审校(廉价档):漏译/误译/术语/人称检查\n autofix_severe: false # 审校后自动重译严重项(漏译/误译);关掉仅上报,不改正文\n align_retry_limit: 2\n polish: true # 润色(强档):等于用 pro 把全书再翻一遍,最烧钱;默认关\n backtranslate_sample: 0 # 回译抽检比例(0 关闭)\n consistency_qa: false # 全书跨章一致性收尾扫描\n rolling_context_segments: 6 # 注入的前文译文尾段数\n book_understanding:\n true # 翻译前预扫源文,生成全书概览+逐章梗概注入翻译(让译者对全书有理解);\n # fast 档免思考,全书概览为恒定前缀可命中缓存复用;关掉省去预扫成本\n prescan_concurrency: 4 # 预扫逐章梗概的并发线程数(各章独立,1=串行)\n glossary_scope: chapter # chapter=只注入本章出现的词条+锁定人物(长书省 token);full=全量表\n\n# ── 敬称策略(日语源文本时生效,其它语言通常不会用到)────────────────────\nhonorific:\n # keep_style: 体现语气(前辈/小X/X君…); normalize: 按统一规则;drop: 省略\n strategy: keep_style\n\n# ── 标点规范化(统一为简体中文大陆通用全角标点)────────────────────────────\npunctuation:\n normalize: true\n\n# ── 路径 ─────────────────────────────────────────────────────────────────\npaths:\n state_dir: state # 运行状态、各章中间产物、术语库\n\n# ── 双语输出 ───────────────────────────────────────────────────────────────\noutput:\n mono: true # 产出单语中文版\n bilingual: true # 产出双语版(原文淡化,与译文对照)\n bilingual_order: target_first # target_first=译文在上原文在下; source_first=原文在上\n"}, "77d01f8777bec200247e1dc8e0f54990ccff16aa": {"t": 1785748699.4361286, "n": 2079, "h": "a4d352599d72a8db", "c": "# trans-novel 配置(多语言小说 → 中文)\n# 修改后无需改代码;模型 ID、档位、流水线开关都在这里。\n\nlanguage:\n source: auto # auto 由模型识别来源语言;也可写死 ja / en / ko / ru / de 等语言代码\n target: zh # 译文语言\n\n# ── LLM:DeepSeek 三档(经 OpenAI SDK 调 https://api.deepseek.com)─────────\n# strong/cheap 开 thinking(求质量的判断类任务);fast 关 thinking(机械任务,\n# thinking 推理 token 按输出计费,关掉大幅省钱提速)。缺档按 fast→cheap→strong 回退。\nllm:\n provider: deepseek # deepseek | fake(fake 用于离线测试,不发网络请求)\n base_url: https://api.deepseek.com\n api_key_env: DEEPSEEK_API_KEY # 从该环境变量读取 key\n timeout: 600 # 单次请求超时(秒),思考模式耗时较长\n max_retries: 4 # 失败重试次数(指数退避)\n tiers:\n strong:\n model: deepseek-v4-pro # 翻译 / 润色 / 全局分析 / 标题\n reasoning_effort: high\n thinking: true\n cheap:\n model: deepseek-v4-flash # 审校 / 一致性 QA / 回译比对(判断类,保留思考)\n reasoning_effort: high\n thinking: true\n fast:\n model: deepseek-v4-flash # 梗概 / 全书概览 / 术语抽取 / 回译(机械任务,免思考)\n thinking: false\n\n# ── 切分 ─────────────────────────────────────────────────────────────────\nsegment:\n # 一个翻译批次(句群)的目标大小,按字符粗略估算 token。\n max_chars_per_batch: 1800\n # 单个段落超过该长度时按句末标点再切成多段(续段回填时并回同段),避免超长段。\n max_chars_per_segment: 1200\n\n# ── 流水线开关(质量/成本平衡)───────────────────────────────────────────\npipeline:\n review: true # 章末整章审校(廉价档):漏译/误译/术语/人称检查\n autofix_severe: false # 审校后自动重译严重项(漏译/误译);关掉仅上报,不改正文\n align_retry_limit: 2\n polish: true # 润色(强档):等于用 pro 把全书再翻一遍,最烧钱;默认关\n backtranslate_sample: 0 # 回译抽检比例(0 关闭)\n consistency_qa: false # 全书跨章一致性收尾扫描\n rolling_context_segments: 6 # 注入的前文译文尾段数\n book_understanding:\n true # 翻译前预扫源文,生成全书概览+逐章梗概注入翻译(让译者对全书有理解);\n # fast 档免思考,全书概览为恒定前缀可命中缓存复用;关掉省去预扫成本\n prescan_concurrency: 4 # 预扫逐章梗概的并发线程数(各章独立,1=串行)\n glossary_scope: chapter # chapter=只注入本章出现的词条+锁定人物(长书省 token);full=全量表\n\n# ── 敬称策略(日语源文本时生效,其它语言通常不会用到)────────────────────\nhonorific:\n # keep_style: 体现语气(前辈/小X/X君…); normalize: 按统一规则;drop: 省略\n strategy: keep_style\n\n# ── 标点规范化(统一为简体中文大陆通用全角标点)────────────────────────────\npunctuation:\n normalize: true\n\n# ── 路径 ─────────────────────────────────────────────────────────────────\npaths:\n state_dir: state # 运行状态、各章中间产物、术语库\n"}, "7bb12bd5c1a615b376a90ce2568f5173d5fc4d39": {"t": 1785748700.494537, "n": 2086, "h": "2173ede76bf83d0d", "c": "# trans-novel 配置(日译中)\n# 修改后无需改代码;模型 ID、档位、流水线开关都在这里。\n\nlanguage:\n source: auto # auto 自动检测来源语言;也可写死 ja / en / ko / de 等语言代码\n target: zh # 译文语言\n\n# ── LLM:DeepSeek 三档(经 OpenAI SDK 调 https://api.deepseek.com)─────────\n# strong/cheap 开 thinking(求质量的判断类任务);fast 关 thinking(机械任务,\n# thinking 推理 token 按输出计费,关掉大幅省钱提速)。缺档按 fast→cheap→strong 回退。\nllm:\n provider: deepseek # deepseek | fake(fake 用于离线测试,不发网络请求)\n base_url: https://api.deepseek.com\n api_key_env: DEEPSEEK_API_KEY # 从该环境变量读取 key\n timeout: 600 # 单次请求超时(秒),思考模式耗时较长\n max_retries: 4 # 失败重试次数(指数退避)\n tiers:\n strong:\n model: deepseek-v4-pro # 翻译 / 润色 / 全局分析 / 标题\n reasoning_effort: high\n thinking: true\n cheap:\n model: deepseek-v4-flash # 审校 / 一致性 QA / 回译比对(判断类,保留思考)\n reasoning_effort: high\n thinking: true\n fast:\n model: deepseek-v4-flash # 梗概 / 全书概览 / 术语抽取 / 回译(机械任务,免思考)\n thinking: false\n\n# ── 切分 ─────────────────────────────────────────────────────────────────\nsegment:\n # 一个翻译批次(句群)的目标大小,按字符估算 token(日文≈1字符1token)。\n max_chars_per_batch: 1800\n # 单个段落超过该长度时按句末标点再切成多段(续段回填时并回同段),避免超长段。\n max_chars_per_segment: 1200\n\n# ── 流水线开关(质量/成本平衡)───────────────────────────────────────────\npipeline:\n review: true # 章末整章审校(廉价档):漏译/误译/术语/人称检查\n autofix_severe: false # 审校后自动重译严重项(漏译/误译);关掉仅上报,不改正文\n align_retry_limit: 2\n polish: true # 润色(强档):等于用 pro 把全书再翻一遍,最烧钱;默认关\n backtranslate_sample: 0 # 回译抽检比例(0 关闭)\n consistency_qa: false # 全书跨章一致性收尾扫描\n rolling_context_segments: 6 # 注入的前文译文尾段数\n book_understanding:\n true # 翻译前预扫源文,生成全书概览+逐章梗概注入翻译(让译者对全书有理解);\n # fast 档免思考,全书概览为恒定前缀可命中缓存复用;关掉省去预扫成本\n prescan_concurrency: 4 # 预扫逐章梗概的并发线程数(各章独立,1=串行)\n glossary_scope: chapter # chapter=只注入本章出现的词条+锁定人物(长书省 token);full=全量表\n\n# ── 敬称策略(日语源专用,英语源忽略)────────────────────────────────────\nhonorific:\n # keep_style: 体现语气(前辈/小X/X君…); normalize: 按统一规则;drop: 省略\n strategy: keep_style\n\n# ── 标点规范化(统一为简体中文大陆通用全角标点)────────────────────────────\npunctuation:\n normalize: true\n\n# ── 路径 ─────────────────────────────────────────────────────────────────\npaths:\n state_dir: state # 运行状态、各章中间产物、术语库\n"}, "3c85b9be9426b9b9131910194816932d720f6cf8": {"t": 1785748701.5557985, "n": 2081, "h": "c44ac91e0997d127", "c": "# trans-novel 配置(日译中)\n# 修改后无需改代码;模型 ID、档位、流水线开关都在这里。\n\nlanguage:\n source: auto # auto 自动检测来源语言(主攻 日/英);也可写死 ja / en\n target: zh # 译文语言\n\n# ── LLM:DeepSeek 三档(经 OpenAI SDK 调 https://api.deepseek.com)─────────\n# strong/cheap 开 thinking(求质量的判断类任务);fast 关 thinking(机械任务,\n# thinking 推理 token 按输出计费,关掉大幅省钱提速)。缺档按 fast→cheap→strong 回退。\nllm:\n provider: deepseek # deepseek | fake(fake 用于离线测试,不发网络请求)\n base_url: https://api.deepseek.com\n api_key_env: DEEPSEEK_API_KEY # 从该环境变量读取 key\n timeout: 600 # 单次请求超时(秒),思考模式耗时较长\n max_retries: 4 # 失败重试次数(指数退避)\n tiers:\n strong:\n model: deepseek-v4-pro # 翻译 / 润色 / 全局分析 / 标题\n reasoning_effort: high\n thinking: true\n cheap:\n model: deepseek-v4-flash # 审校 / 一致性 QA / 回译比对(判断类,保留思考)\n reasoning_effort: high\n thinking: true\n fast:\n model: deepseek-v4-flash # 梗概 / 全书概览 / 术语抽取 / 回译(机械任务,免思考)\n thinking: false\n\n# ── 切分 ─────────────────────────────────────────────────────────────────\nsegment:\n # 一个翻译批次(句群)的目标大小,按字符估算 token(日文≈1字符1token)。\n max_chars_per_batch: 1800\n # 单个段落超过该长度时按句末标点再切成多段(续段回填时并回同段),避免超长段。\n max_chars_per_segment: 1200\n\n# ── 流水线开关(质量/成本平衡)───────────────────────────────────────────\npipeline:\n review: true # 章末整章审校(廉价档):漏译/误译/术语/人称检查\n autofix_severe: false # 审校后自动重译严重项(漏译/误译);关掉仅上报,不改正文\n align_retry_limit: 2\n polish: true # 润色(强档):等于用 pro 把全书再翻一遍,最烧钱;默认关\n backtranslate_sample: 0.05 # 回译抽检比例(0 关闭)\n consistency_qa: false # 全书跨章一致性收尾扫描\n rolling_context_segments: 6 # 注入的前文译文尾段数\n book_understanding:\n true # 翻译前预扫源文,生成全书概览+逐章梗概注入翻译(让译者对全书有理解);\n # fast 档免思考,全书概览为恒定前缀可命中缓存复用;关掉省去预扫成本\n prescan_concurrency: 4 # 预扫逐章梗概的并发线程数(各章独立,1=串行)\n glossary_scope: chapter # chapter=只注入本章出现的词条+锁定人物(长书省 token);full=全量表\n\n# ── 敬称策略(日语源专用,英语源忽略)────────────────────────────────────\nhonorific:\n # keep_style: 体现语气(前辈/小X/X君…); normalize: 按统一规则;drop: 省略\n strategy: keep_style\n\n# ── 标点规范化(统一为简体中文大陆通用全角标点)────────────────────────────\npunctuation:\n normalize: true\n\n# ── 路径 ─────────────────────────────────────────────────────────────────\npaths:\n state_dir: state # 运行状态、各章中间产物、术语库\n"}, "c3d8671b7123dba04e304f958b500e8a9b576ca3": {"t": 1785748703.0652068, "n": 2165, "h": "f457175c6a2e2496", "c": "# trans-novel 配置(日译中)\n# 修改后无需改代码;模型 ID、档位、流水线开关都在这里。\n\nlanguage:\n source: auto # auto 自动检测来源语言(主攻 日/英);也可写死 ja / en\n target: zh # 译文语言\n\n# ── LLM:DeepSeek 三档(经 OpenAI SDK 调 https://api.deepseek.com)─────────\n# strong/cheap 开 thinking(求质量的判断类任务);fast 关 thinking(机械任务,\n# thinking 推理 token 按输出计费,关掉大幅省钱提速)。缺档按 fast→cheap→strong 回退。\nllm:\n provider: deepseek # deepseek | fake(fake 用于离线测试,不发网络请求)\n base_url: https://api.deepseek.com\n api_key_env: DEEPSEEK_API_KEY # 从该环境变量读取 key\n timeout: 600 # 单次请求超时(秒),思考模式耗时较长\n max_retries: 4 # 失败重试次数(指数退避)\n tiers:\n strong:\n model: deepseek-v4-pro # 翻译 / 润色 / 全局分析 / 术语审计 / 标题\n reasoning_effort: high\n thinking: true\n cheap:\n model: deepseek-v4-flash # 审校 / 一致性 QA / 回译比对(判断类,保留思考)\n reasoning_effort: high\n thinking: true\n fast:\n model: deepseek-v4-flash # 梗概 / 全书概览 / 术语抽取 / 回译(机械任务,免思考)\n thinking: false\n\n# ── 切分 ─────────────────────────────────────────────────────────────────\nsegment:\n # 一个翻译批次(句群)的目标大小,按字符估算 token(日文≈1字符1token)。\n max_chars_per_batch: 1800\n # 单个段落超过该长度时按句末标点再切成多段(续段回填时并回同段),避免超长段。\n max_chars_per_segment: 1200\n\n# ── 流水线开关(质量/成本平衡)───────────────────────────────────────────\npipeline:\n review: true # 章末整章审校(廉价档):漏译/误译/术语/人称检查\n autofix_severe: false # 审校后自动重译严重项(漏译/误译);关掉仅上报,不改正文\n align_retry_limit: 2\n polish: true # 润色(强档):等于用 pro 把全书再翻一遍,最烧钱;默认关\n backtranslate_sample: 0.05 # 回译抽检比例(0 关闭)\n consistency_qa: false # 全书跨章一致性收尾扫描\n rolling_context_segments: 6 # 注入的前文译文尾段数\n book_understanding:\n true # 翻译前预扫源文,生成全书概览+逐章梗概注入翻译(让译者对全书有理解);\n # fast 档免思考,全书概览为恒定前缀可命中缓存复用;关掉省去预扫成本\n prescan_concurrency: 4 # 预扫逐章梗概的并发线程数(各章独立,1=串行)\n glossary_scope: chapter # chapter=只注入本章出现的词条+锁定人物(长书省 token);full=全量表\n\n# ── 敬称策略(日语源专用,英语源忽略)────────────────────────────────────\nhonorific:\n # keep_style: 体现语气(前辈/小X/X君…); normalize: 按统一规则;drop: 省略\n strategy: keep_style\n\n# ── 标点规范化(统一为简体中文大陆通用全角标点)────────────────────────────\npunctuation:\n normalize: true\n\n# ── 术语 AI 审计统一(收尾自动消除译法漂移,并改写正文)────────────────────\nglossary_audit: false\n\n# ── 路径 ─────────────────────────────────────────────────────────────────\npaths:\n state_dir: state # 运行状态、各章中间产物、术语库\n"}, "797c4cec5ecb8f97cb99d016f3021f4dbc1449d5": {"t": 1785748704.1660235, "n": 2351, "h": "47a67051e7ae945c", "c": "# trans-novel 配置(日译中)\n# 修改后无需改代码;模型 ID、档位、流水线开关都在这里。\n\nlanguage:\n source: auto # auto 自动检测来源语言(主攻 日/英);也可写死 ja / en\n target: zh # 译文语言\n\n# ── LLM:DeepSeek 三档(经 OpenAI SDK 调 https://api.deepseek.com)─────────\n# strong/cheap 开 thinking(求质量的判断类任务);fast 关 thinking(机械任务,\n# thinking 推理 token 按输出计费,关掉大幅省钱提速)。缺档按 fast→cheap→strong 回退。\nllm:\n provider: deepseek # deepseek | fake(fake 用于离线测试,不发网络请求)\n base_url: https://api.deepseek.com\n api_key_env: DEEPSEEK_API_KEY # 从该环境变量读取 key\n timeout: 600 # 单次请求超时(秒),思考模式耗时较长\n max_retries: 4 # 失败重试次数(指数退避)\n tiers:\n strong:\n model: deepseek-v4-pro # 翻译 / 润色 / 全局分析 / 术语审计 / 标题\n reasoning_effort: high\n thinking: true\n cheap:\n model: deepseek-v4-flash # 审校 / 一致性 QA / 回译比对(判断类,保留思考)\n reasoning_effort: high\n thinking: true\n fast:\n model: deepseek-v4-flash # 梗概 / 全书概览 / 术语抽取 / 回译(机械任务,免思考)\n thinking: false\n\n# ── 切分 ─────────────────────────────────────────────────────────────────\nsegment:\n # 一个翻译批次(句群)的目标大小,按字符估算 token(日文≈1字符1token)。\n max_chars_per_batch: 1800\n # 单个段落超过该长度时按句末标点再切成多段(续段回填时并回同段),避免超长段。\n max_chars_per_segment: 1200\n\n# ── 流水线开关(质量/成本平衡)───────────────────────────────────────────\npipeline:\n review: true # 章末整章审校(廉价档):漏译/误译/术语/人称检查\n autofix_severe: true # 审校后自动重译严重项(漏译/误译,过长度校验才采纳);关闭则仅上报留人工\n align_retry_limit: 2 # 批次翻译段数不符时的整批重试次数,超限后逐段兜底\n polish: false # 润色(强档):已默认关闭——它等于用 pro 把全书再翻一遍,最烧钱;需要时手动开\n backtranslate_sample: 0.05 # 回译抽检比例(0 关闭)\n consistency_qa: true # 全书跨章一致性收尾扫描\n rolling_context_segments: 6 # 注入的前文译文尾段数\n book_understanding: true # 翻译前预扫源文,生成全书概览+逐章梗概注入翻译(让译者对全书有理解);\n # fast 档免思考,全书概览为恒定前缀可命中缓存复用;关掉省去预扫成本\n prescan_concurrency: 4 # 预扫逐章梗概的并发线程数(各章独立,1=串行)\n glossary_scope: chapter # chapter=只注入本章出现的词条+锁定人物(长书省 token);full=全量表\n\n# ── 敬称策略(日语源专用,英语源忽略)────────────────────────────────────\nhonorific:\n # keep_style: 体现语气(前辈/小X/X君…); normalize: 按统一规则;drop: 省略\n strategy: keep_style\n\n# ── 标点规范化(统一为简体中文大陆通用全角标点)────────────────────────────\npunctuation:\n normalize: true\n\n# ── 术语 AI 审计统一(收尾自动消除译法漂移,并改写正文)────────────────────\nglossary_audit: true\n\n# ── 路径 ─────────────────────────────────────────────────────────────────\npaths:\n state_dir: state # 运行状态、各章中间产物、术语库\n"}, "8dad6604a66ca11bbb84de0ce4e6633e80322663": {"t": 1785748705.2471573, "n": 2019, "h": "368993f8110fabb6", "c": "# trans-novel 配置(日译中)\n# 修改后无需改代码;模型 ID、档位、流水线开关都在这里。\n\nlanguage:\n source: auto # auto 自动检测来源语言(主攻 日/英);也可写死 ja / en\n target: zh # 译文语言\n\n# ── LLM:DeepSeek 双档(经 OpenAI SDK 调 https://api.deepseek.com)─────────\n# 两档都开 thinking 模式、reasoning_effort 都用 high(示例只有 high);\n# 成本差异只靠模型区分:强档 pro 求质量,廉价档 flash 控成本。\nllm:\n provider: deepseek # deepseek | fake(fake 用于离线测试,不发网络请求)\n base_url: https://api.deepseek.com\n api_key_env: DEEPSEEK_API_KEY # 从该环境变量读取 key\n timeout: 600 # 单次请求超时(秒),思考模式耗时较长\n max_retries: 4 # 失败重试次数(指数退避)\n tiers:\n strong:\n model: deepseek-v4-pro # 翻译 / 润色 / 全局分析\n reasoning_effort: high\n thinking: true\n cheap:\n model: deepseek-v4-flash # 术语抽取 / 审校 / 一致性 QA / 回译抽检\n reasoning_effort: high\n thinking: true\n\n# ── 切分 ─────────────────────────────────────────────────────────────────\nsegment:\n # 一个翻译批次(句群)的目标大小,按字符估算 token(日文≈1字符1token)。\n max_chars_per_batch: 1800\n # 单个段落超过该长度时按句末标点再切成多段(续段回填时并回同段),避免超长段。\n max_chars_per_segment: 1200\n\n# ── 流水线开关(质量/成本平衡)───────────────────────────────────────────\npipeline:\n review: true # 审校(廉价档):漏译/误译/术语/人称检查——只上报问题供人工介入\n align_retry_limit: 2 # 批次翻译段数不符时的整批重试次数,超限后逐段兜底\n polish: false # 润色(强档):已默认关闭——它等于用 pro 把全书再翻一遍,最烧钱;需要时手动开\n backtranslate_sample: 0.05 # 回译抽检比例(0 关闭)\n consistency_qa: true # 全书跨章一致性收尾扫描\n rolling_context_segments: 6 # 注入的前文译文尾段数\n book_understanding: true # 翻译前预扫源文,生成全书概览+逐章梗概注入翻译(让译者对全书有理解);\n # 廉价档,全书概览为恒定前缀可命中缓存复用;关掉省去预扫成本\n\n# ── 敬称策略(日语源专用,英语源忽略)────────────────────────────────────\nhonorific:\n # keep_style: 体现语气(前辈/小X/X君…); normalize: 按统一规则;drop: 省略\n strategy: keep_style\n\n# ── 标点规范化(统一为简体中文大陆通用全角标点)────────────────────────────\npunctuation:\n normalize: true\n\n# ── 术语 AI 审计统一(收尾自动消除译法漂移,并改写正文)────────────────────\nglossary_audit: true\n\n# ── 路径 ─────────────────────────────────────────────────────────────────\npaths:\n state_dir: state # 运行状态、各章中间产物、术语库\n"}, "d1cdc18a3321d62c34576ddb69aa16b95befac0f": {"t": 1785748706.343217, "n": 2087, "h": "082601ee57bfed3a", "c": "# trans-novel 配置(日译中)\n# 修改后无需改代码;模型 ID、档位、流水线开关都在这里。\n\nlanguage:\n source: auto # auto 自动检测来源语言(主攻 日/英);也可写死 ja / en\n target: zh # 译文语言\n\n# ── LLM:DeepSeek 双档(经 OpenAI SDK 调 https://api.deepseek.com)─────────\n# 两档都开 thinking 模式、reasoning_effort 都用 high(示例只有 high);\n# 成本差异只靠模型区分:强档 pro 求质量,廉价档 flash 控成本。\nllm:\n provider: deepseek # deepseek | fake(fake 用于离线测试,不发网络请求)\n base_url: https://api.deepseek.com\n api_key_env: DEEPSEEK_API_KEY # 从该环境变量读取 key\n timeout: 600 # 单次请求超时(秒),思考模式耗时较长\n max_retries: 4 # 失败重试次数(指数退避)\n tiers:\n strong:\n model: deepseek-v4-pro # 翻译 / 润色 / 全局分析\n reasoning_effort: high\n thinking: true\n cheap:\n model: deepseek-v4-flash # 术语抽取 / 审校 / 一致性 QA / 回译抽检\n reasoning_effort: high\n thinking: true\n\n# ── 切分 ─────────────────────────────────────────────────────────────────\nsegment:\n # 一个翻译批次(句群)的目标大小,按字符估算 token(日文≈1字符1token)。\n max_chars_per_batch: 1800\n # 单个段落超过该长度时按句末标点再切成多段(续段回填时并回同段),避免超长段。\n max_chars_per_segment: 1200\n\n# ── 流水线开关(质量/成本平衡)───────────────────────────────────────────\npipeline:\n review: true # 审校(廉价档):漏译/误译/术语/人称检查——只上报问题供人工介入\n review_retry_limit: 2 # 已弃用:严重项不再自动重译(改为人工介入),此项不生效\n polish: false # 润色(强档):已默认关闭——它等于用 pro 把全书再翻一遍,最烧钱;需要时手动开\n backtranslate_sample: 0.05 # 回译抽检比例(0 关闭)\n consistency_qa: true # 全书跨章一致性收尾扫描\n rolling_context_segments: 6 # 注入的前文译文尾段数\n book_understanding: true # 翻译前预扫源文,生成全书概览+逐章梗概注入翻译(让译者对全书有理解);\n # 廉价档,全书概览为恒定前缀可命中缓存复用;关掉省去预扫成本\n\n# ── 敬称策略(日语源专用,英语源忽略)────────────────────────────────────\nhonorific:\n # keep_style: 体现语气(前辈/小X/X君…); normalize: 按统一规则;drop: 省略\n strategy: keep_style\n\n# ── 已弃用:章内批次现为串行(逐批刷新上下文以保证连贯),此项不再生效,仅为兼容保留 ──\nconcurrency: 1\n\n# ── 标点规范化(统一为简体中文大陆通用全角标点)────────────────────────────\npunctuation:\n normalize: true\n\n# ── 术语 AI 审计统一(收尾自动消除译法漂移,并改写正文)────────────────────\nglossary_audit: true\n\n# ── 路径 ─────────────────────────────────────────────────────────────────\npaths:\n state_dir: state # 运行状态、各章中间产物、术语库\n"}, "dfcd7d0cb84fb8e700f2762629f2902501fd1269": {"t": 1785748707.456124, "n": 1961, "h": "e850e081797ac975", "c": "# trans-novel 配置(日译中)\n# 修改后无需改代码;模型 ID、档位、流水线开关都在这里。\n\nlanguage:\n source: auto # auto 自动检测来源语言(主攻 日/英);也可写死 ja / en\n target: zh # 译文语言\n\n# ── LLM:DeepSeek 双档(经 OpenAI SDK 调 https://api.deepseek.com)─────────\n# 两档都开 thinking 模式、reasoning_effort 都用 high(示例只有 high);\n# 成本差异只靠模型区分:强档 pro 求质量,廉价档 flash 控成本。\nllm:\n provider: deepseek # deepseek | fake(fake 用于离线测试,不发网络请求)\n base_url: https://api.deepseek.com\n api_key_env: DEEPSEEK_API_KEY # 从该环境变量读取 key\n timeout: 600 # 单次请求超时(秒),思考模式耗时较长\n max_retries: 4 # 失败重试次数(指数退避)\n tiers:\n strong:\n model: deepseek-v4-pro # 翻译 / 润色 / 全局分析\n reasoning_effort: high\n thinking: true\n cheap:\n model: deepseek-v4-flash # 术语抽取 / 审校 / 一致性 QA / 回译抽检\n reasoning_effort: high\n thinking: true\n\n# ── 切分 ─────────────────────────────────────────────────────────────────\nsegment:\n # 一个翻译批次(句群)的目标大小,按字符估算 token(日文≈1字符1token)。\n max_chars_per_batch: 1800\n # 单个段落超过该长度时按句末标点再切成多段(续段回填时并回同段),避免超长段。\n max_chars_per_segment: 1200\n\n# ── 流水线开关(质量/成本平衡)───────────────────────────────────────────\npipeline:\n review: true # 审校(廉价档):漏译/误译/术语/人称检查——只上报问题供人工介入\n review_retry_limit: 2 # 已弃用:严重项不再自动重译(改为人工介入),此项不生效\n polish: false # 润色(强档):已默认关闭——它等于用 pro 把全书再翻一遍,最烧钱;需要时手动开\n backtranslate_sample: 0.05 # 回译抽检比例(0 关闭)\n consistency_qa: true # 全书跨章一致性收尾扫描\n rolling_context_segments: 6 # 注入的前文译文尾段数\n\n# ── 敬称策略(日语源专用,英语源忽略)────────────────────────────────────\nhonorific:\n # keep_style: 体现语气(前辈/小X/X君…); normalize: 按统一规则;drop: 省略\n strategy: keep_style\n\n# ── 已弃用:章内批次现为串行(逐批刷新上下文以保证连贯),此项不再生效,仅为兼容保留 ──\nconcurrency: 1\n\n# ── 标点规范化(统一为简体中文大陆通用全角标点)────────────────────────────\npunctuation:\n normalize: true\n\n# ── 术语 AI 审计统一(收尾自动消除译法漂移,并改写正文)────────────────────\nglossary_audit: true\n\n# ── 路径 ─────────────────────────────────────────────────────────────────\npaths:\n state_dir: state # 运行状态、各章中间产物、术语库\n"}, "c9d5d185ae08ed77dc5ed1eae8897f14da87de85": {"t": 1785748708.5412397, "n": 1595, "h": "9ba6275f777104e6", "c": "# trans-novel 配置(日译中)\n# 修改后无需改代码;模型 ID、档位、流水线开关都在这里。\n\nlanguage:\n source: ja # 原文语言\n target: zh # 译文语言\n\n# ── LLM:DeepSeek 双档(经 OpenAI SDK 调 https://api.deepseek.com)─────────\n# 两档都开 thinking 模式;强档 effort 高求质量,廉价档 effort 低控成本。\nllm:\n provider: deepseek # deepseek | fake(fake 用于离线测试,不发网络请求)\n base_url: https://api.deepseek.com\n api_key_env: DEEPSEEK_API_KEY # 从该环境变量读取 key\n timeout: 600 # 单次请求超时(秒),思考模式耗时较长\n max_retries: 4 # 失败重试次数(指数退避)\n tiers:\n strong:\n model: deepseek-v4-pro # 翻译 / 润色 / 全局分析\n reasoning_effort: high\n thinking: true\n cheap:\n model: deepseek-v4-flash # 术语抽取 / 审校 / 一致性 QA / 回译抽检\n reasoning_effort: low\n thinking: true\n\n# ── 切分 ─────────────────────────────────────────────────────────────────\nsegment:\n # 一个翻译批次(句群)的目标大小,按字符估算 token(日文≈1字符1token)。\n max_chars_per_batch: 1800\n # 单个段落超过该长度时按句子再切,避免超长段。\n max_chars_per_segment: 1200\n\n# ── 流水线开关(质量/成本平衡)───────────────────────────────────────────\npipeline:\n review: true # 审校(廉价档):漏译/误译/术语/人称检查\n review_retry_limit: 2 # 审校发现严重问题时的回炉重译上限\n polish: true # 润色(强档):中文文学性二次加工\n backtranslate_sample: 0.05 # 回译抽检比例(0 关闭)\n consistency_qa: true # 全书跨章一致性收尾扫描\n rolling_context_segments: 6 # 注入的前文译文尾段数\n\n# ── 敬称策略(日译中专用)──────────────────────────────────────────────\nhonorific:\n # keep_style: 体现语气(前辈/小X/X君…); normalize: 按统一规则;drop: 省略\n strategy: keep_style\n\n# ── 路径 ─────────────────────────────────────────────────────────────────\npaths:\n state_dir: state # 运行状态、各章中间产物、术语库\n"}}, "README.md": {"9988ff062fc34fd48e1a46faa2c63b9c5c49e75a": {"t": 1785746605.2985196, "n": 10591, "h": "c2585171a1572e6e", "c": "<div align=\"center\">\n\n# 📚 Wenyi\n\n**One command, from EPUB to a readable Chinese translation.**\n\nWhole-book analysis · Real-time glossary · Multi-stage review\n\n[](https://www.python.org/)\n[](https://github.com/BigDawnGhost/wenyi/actions/workflows/tests.yml)\n[](LICENSE)\n[](https://github.com/BigDawnGhost/wenyi/stargazers)\n[](https://discord.gg/Tybfva4HT)\n\n**English** | [简体中文](docs/zh/README.md)\n\n<img src=\"docs/images/bilingual-preview.png\" alt=\"Wenyi bilingual EPUB preview\" width=\"720\">\n\n</div>\n\n---\n\n## Table of contents\n\n- [Why Wenyi](#why-wenyi)\n- [Core features](#core-features)\n- [Quick start](#quick-start)\n- [Supported formats](#supported-formats)\n- [Translation pipeline](#translation-pipeline)\n- [Documentation](#documentation)\n- [Limitations](#limitations)\n- [Community](#community)\n- [Star history](#star-history)\n- [License](#license)\n\n---\n\n## Why Wenyi\n\n| Typical approach | Wenyi |\n|---|---|\n| Segments translated in isolation, unaware of surrounding content | Whole-book prescan with chapter digests and rolling context |\n| Glossary managed manually or as an afterthought | Real-time term extraction with conflict detection, fed back into subsequent batches |\n| Single-pass translation, fragile to interruptions | Batch checkpoints and chapter status tracking: resume any interrupted run with the same command |\n| Raw model output, no systematic quality process | Translate → polish → chapter-level backtranslation sampling → final review → consistency QA |\n\nWenyi is designed for **long-form texts** — novels, social-science monographs, narrative nonfiction, and more.\n\n---\n\n## Core features\n\n- **Whole-book understanding** — prescans the source before translation, creating per-chapter digests and a book-level synopsis injected into every batch\n- **Real-time glossary** — extracts proper names, terms, and recurring expressions as translation progresses; detects conflicting translations and surfaces them for resolution\n- **Multi-stage quality** — optional polishing (strong model), final AI review, backtranslation sampling, and cross-chapter consistency QA\n- **Resumability** — batch-level checkpoints, chapter status tracking, and atomic state writes; interrupt at any point and resume with the same command\n- **Multiple LLM providers** — DeepSeek, OpenAI, OpenRouter, Google Gemini, Ollama, vLLM, and generic OpenAI-compatible endpoints\n- **Native EPUB preservation** — writes translated text back into the original XHTML templates and attempts to preserve styles, images, TOC, and anchors\n- **Bilingual output** — optional source-and-translation edition with visually subdued source text, including dark mode support\n\n---\n\n## Quick start\n\n### Prerequisites\n\nWenyi requires Python 3.10+ and [uv](https://docs.astral.sh/uv/).\n\n### Installation\n\n```bash\ngit clone https://github.com/BigDawnGhost/wenyi.git\ncd wenyi\nuv sync\n```\n\n### Configuration\n\nSet your API key:\n\n```bash\nexport DEEPSEEK_API_KEY=sk-...\n```\n\n### One-command translation\n\n```bash\nuv run trans-novel translate book.epub\n```\n\nThis parses the book, detects the source language, prescans for understanding, translates all chapters, and assembles the output. The monolingual Chinese EPUB is written to `output/book.zh.epub` by default.\n\n### Step-by-step workflow\n\n```bash\n# 1. Prepare — parse, analyze, prescan (no body text translated)\nuv run trans-novel prepare book.epub\n\n# 2. Translate — resume from the prepared state\nuv run trans-novel translate book.epub\n\n# 3. Review — independent final review against the completed glossary\nuv run trans-novel review book.epub\n\n# 4. Consistency QA\nuv run trans-novel qa book.epub\n\n# 5. Check progress\nuv run trans-novel status book.epub\n```\n\n### Interrupt and resume\n\nEvery completed batch is persisted immediately. If a run is interrupted, execute the same command again:\n\n```bash\nuv run trans-novel translate book.epub\n```\n\n### Command-line overrides\n\n```bash\nuv run trans-novel translate book.epub --polish --review --qa # enable all quality stages\nuv run trans-novel translate book.epub --no-polish # disable polishing\nuv run trans-novel translate book.epub --bilingual # produce both editions\nuv run trans-novel translate book.epub --chapter 0 # translate the first chapter (indices start at 0)\nuv run trans-novel translate book.epub --format txt # export as plain text\n```\n\nFinal review is disabled by default. Set `pipeline.review: true` to run it\nautomatically after the complete book has been translated and the glossary has\nreached its final state, or run Agent Review independently:\n\n```bash\nuv run trans-novel review book.epub\n```\n\nEach Review run starts from the beginning, checks chunks concurrently, and can\nselectively request cross-book evidence before resolving contradictory\nconsistency suggestions. Confirmed issues can produce provisional full-segment\nreplacements in a run-local shadow translation. A fresh whole-book review sees\nthe shadow text—but not the previous issue explanation—and validates it again.\nFormal translation state is never modified. The consolidated read-only result,\nrun usage, events, and internal round records are written under\n`state/<book>/reviews/review-<timestamp>/`.\n\n---\n\n## Supported formats\n\n| Input | Output |\n|---|---|\n| EPUB, FB2, TXT, Markdown, HTML, PDF | EPUB (monolingual / bilingual), TXT, HTML, Markdown |\n\n- PDF input requires `MINERU_API_KEY` for the initial conversion; the resulting HTML is cached and reused.\n- EPUB output attempts to preserve the original book's styles, images, table of contents, and anchors. Vertical layout is converted to horizontal for Chinese reading.\n- Source language is auto-detected by default, or fixed to an ISO 639-1 code in `config.yaml`.\n\n---\n\n## Translation pipeline\n\n```mermaid\nflowchart TD\n A[Input file] --> B[Parse chapters and detect language]\n B --> C[Analyze style and seed the glossary]\n C --> D[Optional parallel prescan<br/>Chapter digests and book synopsis]\n D --> E\n\n subgraph T[Translate chapter by chapter]\n E[Inject context and translate a batch]\n E --> F[Polish and persist translations]\n F --> G[Extract terms and refresh the glossary]\n G --> H{More batches?}\n H -- Yes --> E\n H -- No --> I[Normalize punctuation and run chapter-level term extraction]\n I --> J[Check backtranslation samples and persist the final chapter]\n end\n\n J --> K[Optional parallel whole-book review<br/>Using the completed glossary]\n K --> N{Confirmed issues and<br/>Fix budget remaining?}\n N -- Yes --> O[Generate provisional shadow fixes<br/>From one immutable snapshot]\n O --> K\n N -- No or stopped --> P[Save read-only issues<br/>and modification suggestions]\n P --> L[Optional cross-chapter consistency QA]\n L --> M[Generate the report and assemble the selected output]\n```\n\nWhen enabled, the prescan runs in parallel with configurable concurrency and is idempotent — completed digests are reused across runs. During translation, each batch receives the most recent glossary snapshot and translated context, keeping pronouns, terms, and tone consistent across chapters.\nThe Review Fixer receives the same style brief, book synopsis, chapter digest,\nrelevant glossary subset, and nearby source/translation context used to preserve\nthe book's voice. Its replacements remain temporary review suggestions.\n\n---\n\n## Documentation\n\n- [Usage guide](docs/usage.md) — installation, Windows setup, input/output, resumability, independent stages\n- [Configuration](docs/configuration.md) — providers, languages, pipeline switches, segmentation, paths\n- [Translation pipeline](docs/pipeline.md) — whole-book analysis, terminology, context, polishing, review\n- [Contributing](CONTRIBUTING.md) — development, testing, and contribution guidelines\n\nTranslated state directories for public-domain books may be shared through [wenyi-bookcase](https://github.com/BigDawnGhost/wenyi-bookcase). Do not publish copyrighted text, private books, or `state/` directories containing sensitive information without permission.\n\n---\n\n## Limitations\n\n- The translation pipeline is optimized for Simplified Chinese output; other target languages are not supported.\n- Polishing and final review are the most expensive stages. Shadow fixing may\n trigger multiple full-book review passes and additional Fixer calls.\n- PDF input depends on the MinerU external service; the initial conversion requires an API key.\n- Translation quality is bounded by the capabilities of the chosen LLM model.\n- Very long books may produce large state directories; storage requirements grow with book length.\n\n---\n\n## Community\n\n- [Discord server](https://discord.gg/Tybfva4HT)\n- QQ group: 1055065098\n- [GitHub Issues](https://github.com/BigDawnGhost/wenyi/issues) — bug reports and feature requests\n- [GitHub Discussions](https://github.com/BigDawnGhost/wenyi/discussions) — ideas and questions\n\n---\n\n## Star history\n\n<a href=\"https://www.star-history.com/?repos=BigDawnGhost%2FWenyi&type=date&legend=top-left\">\n <picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&theme=dark&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <source media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <img alt=\"Star History Chart\" src=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n </picture>\n</a>\n\n---\n\n## License\n\n[MIT](LICENSE)\n"}, "d9db1e20aa44f0944c8ee4e3af3c2efc89ab4938": {"t": 1785748681.2491095, "n": 10591, "h": "c2585171a1572e6e", "c": "<div align=\"center\">\n\n# 📚 Wenyi\n\n**One command, from EPUB to a readable Chinese translation.**\n\nWhole-book analysis · Real-time glossary · Multi-stage review\n\n[](https://www.python.org/)\n[](https://github.com/BigDawnGhost/wenyi/actions/workflows/tests.yml)\n[](LICENSE)\n[](https://github.com/BigDawnGhost/wenyi/stargazers)\n[](https://discord.gg/Tybfva4HT)\n\n**English** | [简体中文](docs/zh/README.md)\n\n<img src=\"docs/images/bilingual-preview.png\" alt=\"Wenyi bilingual EPUB preview\" width=\"720\">\n\n</div>\n\n---\n\n## Table of contents\n\n- [Why Wenyi](#why-wenyi)\n- [Core features](#core-features)\n- [Quick start](#quick-start)\n- [Supported formats](#supported-formats)\n- [Translation pipeline](#translation-pipeline)\n- [Documentation](#documentation)\n- [Limitations](#limitations)\n- [Community](#community)\n- [Star history](#star-history)\n- [License](#license)\n\n---\n\n## Why Wenyi\n\n| Typical approach | Wenyi |\n|---|---|\n| Segments translated in isolation, unaware of surrounding content | Whole-book prescan with chapter digests and rolling context |\n| Glossary managed manually or as an afterthought | Real-time term extraction with conflict detection, fed back into subsequent batches |\n| Single-pass translation, fragile to interruptions | Batch checkpoints and chapter status tracking: resume any interrupted run with the same command |\n| Raw model output, no systematic quality process | Translate → polish → chapter-level backtranslation sampling → final review → consistency QA |\n\nWenyi is designed for **long-form texts** — novels, social-science monographs, narrative nonfiction, and more.\n\n---\n\n## Core features\n\n- **Whole-book understanding** — prescans the source before translation, creating per-chapter digests and a book-level synopsis injected into every batch\n- **Real-time glossary** — extracts proper names, terms, and recurring expressions as translation progresses; detects conflicting translations and surfaces them for resolution\n- **Multi-stage quality** — optional polishing (strong model), final AI review, backtranslation sampling, and cross-chapter consistency QA\n- **Resumability** — batch-level checkpoints, chapter status tracking, and atomic state writes; interrupt at any point and resume with the same command\n- **Multiple LLM providers** — DeepSeek, OpenAI, OpenRouter, Google Gemini, Ollama, vLLM, and generic OpenAI-compatible endpoints\n- **Native EPUB preservation** — writes translated text back into the original XHTML templates and attempts to preserve styles, images, TOC, and anchors\n- **Bilingual output** — optional source-and-translation edition with visually subdued source text, including dark mode support\n\n---\n\n## Quick start\n\n### Prerequisites\n\nWenyi requires Python 3.10+ and [uv](https://docs.astral.sh/uv/).\n\n### Installation\n\n```bash\ngit clone https://github.com/BigDawnGhost/wenyi.git\ncd wenyi\nuv sync\n```\n\n### Configuration\n\nSet your API key:\n\n```bash\nexport DEEPSEEK_API_KEY=sk-...\n```\n\n### One-command translation\n\n```bash\nuv run trans-novel translate book.epub\n```\n\nThis parses the book, detects the source language, prescans for understanding, translates all chapters, and assembles the output. The monolingual Chinese EPUB is written to `output/book.zh.epub` by default.\n\n### Step-by-step workflow\n\n```bash\n# 1. Prepare — parse, analyze, prescan (no body text translated)\nuv run trans-novel prepare book.epub\n\n# 2. Translate — resume from the prepared state\nuv run trans-novel translate book.epub\n\n# 3. Review — independent final review against the completed glossary\nuv run trans-novel review book.epub\n\n# 4. Consistency QA\nuv run trans-novel qa book.epub\n\n# 5. Check progress\nuv run trans-novel status book.epub\n```\n\n### Interrupt and resume\n\nEvery completed batch is persisted immediately. If a run is interrupted, execute the same command again:\n\n```bash\nuv run trans-novel translate book.epub\n```\n\n### Command-line overrides\n\n```bash\nuv run trans-novel translate book.epub --polish --review --qa # enable all quality stages\nuv run trans-novel translate book.epub --no-polish # disable polishing\nuv run trans-novel translate book.epub --bilingual # produce both editions\nuv run trans-novel translate book.epub --chapter 0 # translate the first chapter (indices start at 0)\nuv run trans-novel translate book.epub --format txt # export as plain text\n```\n\nFinal review is disabled by default. Set `pipeline.review: true` to run it\nautomatically after the complete book has been translated and the glossary has\nreached its final state, or run Agent Review independently:\n\n```bash\nuv run trans-novel review book.epub\n```\n\nEach Review run starts from the beginning, checks chunks concurrently, and can\nselectively request cross-book evidence before resolving contradictory\nconsistency suggestions. Confirmed issues can produce provisional full-segment\nreplacements in a run-local shadow translation. A fresh whole-book review sees\nthe shadow text—but not the previous issue explanation—and validates it again.\nFormal translation state is never modified. The consolidated read-only result,\nrun usage, events, and internal round records are written under\n`state/<book>/reviews/review-<timestamp>/`.\n\n---\n\n## Supported formats\n\n| Input | Output |\n|---|---|\n| EPUB, FB2, TXT, Markdown, HTML, PDF | EPUB (monolingual / bilingual), TXT, HTML, Markdown |\n\n- PDF input requires `MINERU_API_KEY` for the initial conversion; the resulting HTML is cached and reused.\n- EPUB output attempts to preserve the original book's styles, images, table of contents, and anchors. Vertical layout is converted to horizontal for Chinese reading.\n- Source language is auto-detected by default, or fixed to an ISO 639-1 code in `config.yaml`.\n\n---\n\n## Translation pipeline\n\n```mermaid\nflowchart TD\n A[Input file] --> B[Parse chapters and detect language]\n B --> C[Analyze style and seed the glossary]\n C --> D[Optional parallel prescan<br/>Chapter digests and book synopsis]\n D --> E\n\n subgraph T[Translate chapter by chapter]\n E[Inject context and translate a batch]\n E --> F[Polish and persist translations]\n F --> G[Extract terms and refresh the glossary]\n G --> H{More batches?}\n H -- Yes --> E\n H -- No --> I[Normalize punctuation and run chapter-level term extraction]\n I --> J[Check backtranslation samples and persist the final chapter]\n end\n\n J --> K[Optional parallel whole-book review<br/>Using the completed glossary]\n K --> N{Confirmed issues and<br/>Fix budget remaining?}\n N -- Yes --> O[Generate provisional shadow fixes<br/>From one immutable snapshot]\n O --> K\n N -- No or stopped --> P[Save read-only issues<br/>and modification suggestions]\n P --> L[Optional cross-chapter consistency QA]\n L --> M[Generate the report and assemble the selected output]\n```\n\nWhen enabled, the prescan runs in parallel with configurable concurrency and is idempotent — completed digests are reused across runs. During translation, each batch receives the most recent glossary snapshot and translated context, keeping pronouns, terms, and tone consistent across chapters.\nThe Review Fixer receives the same style brief, book synopsis, chapter digest,\nrelevant glossary subset, and nearby source/translation context used to preserve\nthe book's voice. Its replacements remain temporary review suggestions.\n\n---\n\n## Documentation\n\n- [Usage guide](docs/usage.md) — installation, Windows setup, input/output, resumability, independent stages\n- [Configuration](docs/configuration.md) — providers, languages, pipeline switches, segmentation, paths\n- [Translation pipeline](docs/pipeline.md) — whole-book analysis, terminology, context, polishing, review\n- [Contributing](CONTRIBUTING.md) — development, testing, and contribution guidelines\n\nTranslated state directories for public-domain books may be shared through [wenyi-bookcase](https://github.com/BigDawnGhost/wenyi-bookcase). Do not publish copyrighted text, private books, or `state/` directories containing sensitive information without permission.\n\n---\n\n## Limitations\n\n- The translation pipeline is optimized for Simplified Chinese output; other target languages are not supported.\n- Polishing and final review are the most expensive stages. Shadow fixing may\n trigger multiple full-book review passes and additional Fixer calls.\n- PDF input depends on the MinerU external service; the initial conversion requires an API key.\n- Translation quality is bounded by the capabilities of the chosen LLM model.\n- Very long books may produce large state directories; storage requirements grow with book length.\n\n---\n\n## Community\n\n- [Discord server](https://discord.gg/Tybfva4HT)\n- QQ group: 1055065098\n- [GitHub Issues](https://github.com/BigDawnGhost/wenyi/issues) — bug reports and feature requests\n- [GitHub Discussions](https://github.com/BigDawnGhost/wenyi/discussions) — ideas and questions\n\n---\n\n## Star history\n\n<a href=\"https://www.star-history.com/?repos=BigDawnGhost%2FWenyi&type=date&legend=top-left\">\n <picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&theme=dark&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <source media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <img alt=\"Star History Chart\" src=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n </picture>\n</a>\n\n---\n\n## License\n\n[MIT](LICENSE)\n"}, "86d6d0b17b27658a024b11b5ddf8a32a3c308729": {"t": 1785748682.3563983, "n": 10467, "h": "4476080f40a2cfb3", "c": "<div align=\"center\">\n\n# 📚 Wenyi\n\n**One command, from EPUB to a readable Chinese translation.**\n\nWhole-book analysis · Real-time glossary · Multi-stage review\n\n[](https://www.python.org/)\n[](https://github.com/BigDawnGhost/wenyi/actions/workflows/tests.yml)\n[](LICENSE)\n[](https://github.com/BigDawnGhost/wenyi/stargazers)\n[](https://discord.gg/Tybfva4HT)\n\n**English** | [简体中文](docs/zh/README.md)\n\n<img src=\"docs/images/bilingual-preview.png\" alt=\"Wenyi bilingual EPUB preview\" width=\"720\">\n\n</div>\n\n---\n\n## Table of contents\n\n- [Why Wenyi](#why-wenyi)\n- [Core features](#core-features)\n- [Quick start](#quick-start)\n- [Supported formats](#supported-formats)\n- [Translation pipeline](#translation-pipeline)\n- [Documentation](#documentation)\n- [Limitations](#limitations)\n- [Community](#community)\n- [Star history](#star-history)\n- [License](#license)\n\n---\n\n## Why Wenyi\n\n| Typical approach | Wenyi |\n|---|---|\n| Segments translated in isolation, unaware of surrounding content | Whole-book prescan with chapter digests and rolling context |\n| Glossary managed manually or as an afterthought | Real-time term extraction with conflict detection, fed back into subsequent batches |\n| Single-pass translation, fragile to interruptions | Batch checkpoints and chapter status tracking: resume any interrupted run with the same command |\n| Raw model output, no systematic quality process | Translate → polish → chapter-level backtranslation sampling → final review → consistency QA |\n\nWenyi is designed for **long-form texts** — novels, social-science monographs, narrative nonfiction, and more.\n\n---\n\n## Core features\n\n- **Whole-book understanding** — prescans the source before translation, creating per-chapter digests and a book-level synopsis injected into every batch\n- **Real-time glossary** — extracts proper names, terms, and recurring expressions as translation progresses; detects conflicting translations and surfaces them for resolution\n- **Multi-stage quality** — optional polishing (strong model), final AI review, backtranslation sampling, and cross-chapter consistency QA\n- **Resumability** — batch-level checkpoints, chapter status tracking, and atomic state writes; interrupt at any point and resume with the same command\n- **Multiple LLM providers** — DeepSeek, OpenAI, OpenRouter, Google Gemini, Ollama, vLLM, and generic OpenAI-compatible endpoints\n- **Native EPUB preservation** — writes translated text back into the original XHTML templates and attempts to preserve styles, images, TOC, and anchors\n- **Bilingual output** — optional source-and-translation edition with visually subdued source text, including dark mode support\n\n---\n\n## Quick start\n\n### Prerequisites\n\nWenyi requires Python 3.10+ and [uv](https://docs.astral.sh/uv/).\n\n### Installation\n\n```bash\ngit clone https://github.com/BigDawnGhost/wenyi.git\ncd wenyi\nuv sync\n```\n\n### Configuration\n\nSet your API key:\n\n```bash\nexport DEEPSEEK_API_KEY=sk-...\n```\n\n### One-command translation\n\n```bash\nuv run trans-novel translate book.epub\n```\n\nThis parses the book, detects the source language, prescans for understanding, translates all chapters, and assembles the output. The monolingual Chinese EPUB is written to `output/book.zh.epub` by default.\n\n### Step-by-step workflow\n\n```bash\n# 1. Prepare — parse, analyze, prescan (no body text translated)\nuv run trans-novel prepare book.epub\n\n# 2. Translate — resume from the prepared state\nuv run trans-novel translate book.epub\n\n# 3. Review — independent final review against the completed glossary\nuv run trans-novel review book.epub\n\n# 4. Consistency QA\nuv run trans-novel qa book.epub\n\n# 5. Check progress\nuv run trans-novel status book.epub\n```\n\n### Interrupt and resume\n\nEvery completed batch is persisted immediately. If a run is interrupted, execute the same command again:\n\n```bash\nuv run trans-novel translate book.epub\n```\n\n### Command-line overrides\n\n```bash\nuv run trans-novel translate book.epub --polish --review --qa # enable all quality stages\nuv run trans-novel translate book.epub --no-polish # disable polishing\nuv run trans-novel translate book.epub --bilingual # produce both editions\nuv run trans-novel translate book.epub --chapter 0 # translate the first chapter (indices start at 0)\nuv run trans-novel translate book.epub --format txt # export as plain text\n```\n\nFinal review is disabled by default. Set `pipeline.review: true` to run it\nautomatically after the complete book has been translated and the glossary has\nreached its final state, or run the experimental Agent Review independently:\n\n```bash\nuv run trans-novel review book.epub\n```\n\nEach Review run starts from the beginning, checks chunks concurrently, and can\nselectively request cross-book evidence before resolving contradictory\nconsistency suggestions. Confirmed issues can produce provisional full-segment\nreplacements in a Debug-only shadow translation. A fresh whole-book review sees\nthe shadow text—but not the previous issue explanation—and validates it again.\nFormal translation state is never modified; traces, shadow patches, and remaining\nrecommendations are written under `state/<book>/debug/`.\n\n---\n\n## Supported formats\n\n| Input | Output |\n|---|---|\n| EPUB, FB2, TXT, Markdown, HTML, PDF | EPUB (monolingual / bilingual), TXT, HTML, Markdown |\n\n- PDF input requires `MINERU_API_KEY` for the initial conversion; the resulting HTML is cached and reused.\n- EPUB output attempts to preserve the original book's styles, images, table of contents, and anchors. Vertical layout is converted to horizontal for Chinese reading.\n- Source language is auto-detected by default, or fixed to an ISO 639-1 code in `config.yaml`.\n\n---\n\n## Translation pipeline\n\n```mermaid\nflowchart TD\n A[Input file] --> B[Parse chapters and detect language]\n B --> C[Analyze style and seed the glossary]\n C --> D[Optional parallel prescan<br/>Chapter digests and book synopsis]\n D --> E\n\n subgraph T[Translate chapter by chapter]\n E[Inject context and translate a batch]\n E --> F[Polish and persist translations]\n F --> G[Extract terms and refresh the glossary]\n G --> H{More batches?}\n H -- Yes --> E\n H -- No --> I[Normalize punctuation and run chapter-level term extraction]\n I --> J[Check backtranslation samples and persist the final chapter]\n end\n\n J --> K[Optional parallel whole-book review<br/>Using the completed glossary]\n K --> N{Confirmed issues?}\n N -- Yes --> O[Generate provisional shadow fixes<br/>From one immutable snapshot]\n O --> K\n N -- No, confirmed twice --> L[Optional cross-chapter consistency QA]\n L --> M[Generate the report and assemble the selected output]\n```\n\nWhen enabled, the prescan runs in parallel with configurable concurrency and is idempotent — completed digests are reused across runs. During translation, each batch receives the most recent glossary snapshot and translated context, keeping pronouns, terms, and tone consistent across chapters.\nThe Review Fixer receives the same style brief, book synopsis, chapter digest,\nrelevant glossary subset, and nearby source/translation context used to preserve\nthe book's voice. Its replacements remain temporary Debug artifacts.\n\n---\n\n## Documentation\n\n- [Usage guide](docs/usage.md) — installation, Windows setup, input/output, resumability, independent stages\n- [Configuration](docs/configuration.md) — providers, languages, pipeline switches, segmentation, paths\n- [Translation pipeline](docs/pipeline.md) — whole-book analysis, terminology, context, polishing, review\n- [Contributing](CONTRIBUTING.md) — development, testing, and contribution guidelines\n\nTranslated state directories for public-domain books may be shared through [wenyi-bookcase](https://github.com/BigDawnGhost/wenyi-bookcase). Do not publish copyrighted text, private books, or `state/` directories containing sensitive information without permission.\n\n---\n\n## Limitations\n\n- The translation pipeline is optimized for Simplified Chinese output; other target languages are not supported.\n- Polishing and final review are the most expensive stages. Shadow fixing may\n trigger multiple full-book review passes and additional Fixer calls.\n- PDF input depends on the MinerU external service; the initial conversion requires an API key.\n- Translation quality is bounded by the capabilities of the chosen LLM model.\n- Very long books may produce large state directories; storage requirements grow with book length.\n\n---\n\n## Community\n\n- [Discord server](https://discord.gg/Tybfva4HT)\n- QQ group: 1055065098\n- [GitHub Issues](https://github.com/BigDawnGhost/wenyi/issues) — bug reports and feature requests\n- [GitHub Discussions](https://github.com/BigDawnGhost/wenyi/discussions) — ideas and questions\n\n---\n\n## Star history\n\n<a href=\"https://www.star-history.com/?repos=BigDawnGhost%2FWenyi&type=date&legend=top-left\">\n <picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&theme=dark&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <source media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <img alt=\"Star History Chart\" src=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n </picture>\n</a>\n\n---\n\n## License\n\n[MIT](LICENSE)\n"}, "17b485091a7810744ab9d83bc6e6a2cb33bd6e04": {"t": 1785748683.4467297, "n": 9844, "h": "0f5a33c321d46156", "c": "<div align=\"center\">\n\n# 📚 Wenyi\n\n**One command, from EPUB to a readable Chinese translation.**\n\nWhole-book analysis · Real-time glossary · Multi-stage review\n\n[](https://www.python.org/)\n[](https://github.com/BigDawnGhost/wenyi/actions/workflows/tests.yml)\n[](LICENSE)\n[](https://github.com/BigDawnGhost/wenyi/stargazers)\n[](https://discord.gg/Tybfva4HT)\n\n**English** | [简体中文](docs/zh/README.md)\n\n<img src=\"docs/images/bilingual-preview.png\" alt=\"Wenyi bilingual EPUB preview\" width=\"720\">\n\n</div>\n\n---\n\n## Table of contents\n\n- [Why Wenyi](#why-wenyi)\n- [Core features](#core-features)\n- [Quick start](#quick-start)\n- [Supported formats](#supported-formats)\n- [Translation pipeline](#translation-pipeline)\n- [Documentation](#documentation)\n- [Limitations](#limitations)\n- [Community](#community)\n- [Star history](#star-history)\n- [License](#license)\n\n---\n\n## Why Wenyi\n\n| Typical approach | Wenyi |\n|---|---|\n| Segments translated in isolation, unaware of surrounding content | Whole-book prescan with chapter digests and rolling context |\n| Glossary managed manually or as an afterthought | Real-time term extraction with conflict detection, fed back into subsequent batches |\n| Single-pass translation, fragile to interruptions | Batch checkpoints and chapter status tracking: resume any interrupted run with the same command |\n| Raw model output, no systematic quality process | Translate → polish → chapter-level backtranslation sampling → final review → consistency QA |\n\nWenyi is designed for **long-form texts** — novels, social-science monographs, narrative nonfiction, and more.\n\n---\n\n## Core features\n\n- **Whole-book understanding** — prescans the source before translation, creating per-chapter digests and a book-level synopsis injected into every batch\n- **Real-time glossary** — extracts proper names, terms, and recurring expressions as translation progresses; detects conflicting translations and surfaces them for resolution\n- **Multi-stage quality** — optional polishing (strong model), final AI review, backtranslation sampling, and cross-chapter consistency QA\n- **Resumability** — batch-level checkpoints, chapter status tracking, and atomic state writes; interrupt at any point and resume with the same command\n- **Multiple LLM providers** — DeepSeek, OpenAI, OpenRouter, Google Gemini, Ollama, vLLM, and generic OpenAI-compatible endpoints\n- **Native EPUB preservation** — writes translated text back into the original XHTML templates and attempts to preserve styles, images, TOC, and anchors\n- **Bilingual output** — optional source-and-translation edition with visually subdued source text, including dark mode support\n\n---\n\n## Quick start\n\n### Prerequisites\n\nWenyi requires Python 3.10+ and [uv](https://docs.astral.sh/uv/).\n\n### Installation\n\n```bash\ngit clone https://github.com/BigDawnGhost/wenyi.git\ncd wenyi\nuv sync\n```\n\n### Configuration\n\nSet your API key:\n\n```bash\nexport DEEPSEEK_API_KEY=sk-...\n```\n\n### One-command translation\n\n```bash\nuv run trans-novel translate book.epub\n```\n\nThis parses the book, detects the source language, prescans for understanding, translates all chapters, and assembles the output. The monolingual Chinese EPUB is written to `output/book.zh.epub` by default.\n\n### Step-by-step workflow\n\n```bash\n# 1. Prepare — parse, analyze, prescan (no body text translated)\nuv run trans-novel prepare book.epub\n\n# 2. Translate — resume from the prepared state\nuv run trans-novel translate book.epub\n\n# 3. Review — independent final review against the completed glossary\nuv run trans-novel review book.epub\n\n# 4. Consistency QA\nuv run trans-novel qa book.epub\n\n# 5. Check progress\nuv run trans-novel status book.epub\n```\n\n### Interrupt and resume\n\nEvery completed batch is persisted immediately. If a run is interrupted, execute the same command again:\n\n```bash\nuv run trans-novel translate book.epub\n```\n\n### Command-line overrides\n\n```bash\nuv run trans-novel translate book.epub --polish --review --qa # enable all quality stages\nuv run trans-novel translate book.epub --no-polish # disable polishing\nuv run trans-novel translate book.epub --bilingual # produce both editions\nuv run trans-novel translate book.epub --chapter 0 # translate the first chapter (indices start at 0)\nuv run trans-novel translate book.epub --format txt # export as plain text\n```\n\nFinal review is disabled by default. Set `pipeline.review: true` to run it\nautomatically after the complete book has been translated and the glossary has\nreached its final state, or run the experimental Agent Review independently:\n\n```bash\nuv run trans-novel review book.epub\n```\n\nEach Review run starts from the beginning, checks chunks concurrently, and can\nselectively request cross-book evidence before resolving contradictory\nconsistency suggestions. It does not fix or modify formal translation state;\ncomplete traces and recommendations are written to a timestamped directory\nunder `state/<book>/debug/`.\n\n---\n\n## Supported formats\n\n| Input | Output |\n|---|---|\n| EPUB, FB2, TXT, Markdown, HTML, PDF | EPUB (monolingual / bilingual), TXT, HTML, Markdown |\n\n- PDF input requires `MINERU_API_KEY` for the initial conversion; the resulting HTML is cached and reused.\n- EPUB output attempts to preserve the original book's styles, images, table of contents, and anchors. Vertical layout is converted to horizontal for Chinese reading.\n- Source language is auto-detected by default, or fixed to an ISO 639-1 code in `config.yaml`.\n\n---\n\n## Translation pipeline\n\n```mermaid\nflowchart TD\n A[Input file] --> B[Parse chapters and detect language]\n B --> C[Analyze style and seed the glossary]\n C --> D[Optional parallel prescan<br/>Chapter digests and book synopsis]\n D --> E\n\n subgraph T[Translate chapter by chapter]\n E[Inject context and translate a batch]\n E --> F[Polish and persist translations]\n F --> G[Extract terms and refresh the glossary]\n G --> H{More batches?}\n H -- Yes --> E\n H -- No --> I[Normalize punctuation and run chapter-level term extraction]\n I --> J[Check backtranslation samples and persist the final chapter]\n end\n\n J --> K[Optional parallel final review<br/>Using the completed glossary]\n K --> L[Optional cross-chapter consistency QA]\n L --> M[Generate the report and assemble the selected output]\n```\n\nWhen enabled, the prescan runs in parallel with configurable concurrency and is idempotent — completed digests are reused across runs. During translation, each batch receives the most recent glossary snapshot and translated context, keeping pronouns, terms, and tone consistent across chapters.\n\n---\n\n## Documentation\n\n- [Usage guide](docs/usage.md) — installation, Windows setup, input/output, resumability, independent stages\n- [Configuration](docs/configuration.md) — providers, languages, pipeline switches, segmentation, paths\n- [Translation pipeline](docs/pipeline.md) — whole-book analysis, terminology, context, polishing, review\n- [Contributing](CONTRIBUTING.md) — development, testing, and contribution guidelines\n\nTranslated state directories for public-domain books may be shared through [wenyi-bookcase](https://github.com/BigDawnGhost/wenyi-bookcase). Do not publish copyrighted text, private books, or `state/` directories containing sensitive information without permission.\n\n---\n\n## Limitations\n\n- The translation pipeline is optimized for Simplified Chinese output; other target languages are not supported.\n- Polishing and final review are the most expensive stages — they significantly increase token consumption.\n- PDF input depends on the MinerU external service; the initial conversion requires an API key.\n- Translation quality is bounded by the capabilities of the chosen LLM model.\n- Very long books may produce large state directories; storage requirements grow with book length.\n\n---\n\n## Community\n\n- [Discord server](https://discord.gg/Tybfva4HT)\n- QQ group: 1055065098\n- [GitHub Issues](https://github.com/BigDawnGhost/wenyi/issues) — bug reports and feature requests\n- [GitHub Discussions](https://github.com/BigDawnGhost/wenyi/discussions) — ideas and questions\n\n---\n\n## Star history\n\n<a href=\"https://www.star-history.com/?repos=BigDawnGhost%2FWenyi&type=date&legend=top-left\">\n <picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&theme=dark&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <source media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <img alt=\"Star History Chart\" src=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n </picture>\n</a>\n\n---\n\n## License\n\n[MIT](LICENSE)\n"}, "7dd3971980bfd73e751f02d8cacff8ca97e64aee": {"t": 1785748684.5452845, "n": 9231, "h": "1f68a220dccd5501", "c": "<div align=\"center\">\n\n# 📚 Wenyi\n\n**One command, from EPUB to a readable Chinese translation.**\n\nWhole-book analysis · Real-time glossary · Multi-stage review\n\n[](https://www.python.org/)\n[](https://github.com/BigDawnGhost/wenyi/actions/workflows/tests.yml)\n[](LICENSE)\n[](https://github.com/BigDawnGhost/wenyi/stargazers)\n[](https://discord.gg/Tybfva4HT)\n\n**English** | [简体中文](docs/zh/README.md)\n\n<img src=\"docs/images/bilingual-preview.png\" alt=\"Wenyi bilingual EPUB preview\" width=\"720\">\n\n</div>\n\n---\n\n## Table of contents\n\n- [Why Wenyi](#why-wenyi)\n- [Core features](#core-features)\n- [Quick start](#quick-start)\n- [Supported formats](#supported-formats)\n- [Translation pipeline](#translation-pipeline)\n- [Documentation](#documentation)\n- [Limitations](#limitations)\n- [Community](#community)\n- [Star history](#star-history)\n- [License](#license)\n\n---\n\n## Why Wenyi\n\n| Typical approach | Wenyi |\n|---|---|\n| Segments translated in isolation, unaware of surrounding content | Whole-book prescan with chapter digests and rolling context |\n| Glossary managed manually or as an afterthought | Real-time term extraction with conflict detection, fed back into subsequent batches |\n| Single-pass translation, fragile to interruptions | Batch checkpoints and chapter status tracking: resume any interrupted run with the same command |\n| Raw model output, no systematic quality process | Translate → polish → chapter-level backtranslation sampling → final review → consistency QA |\n\nWenyi is designed for **long-form texts** — novels, social-science monographs, narrative nonfiction, and more.\n\n---\n\n## Core features\n\n- **Whole-book understanding** — prescans the source before translation, creating per-chapter digests and a book-level synopsis injected into every batch\n- **Real-time glossary** — extracts proper names, terms, and recurring expressions as translation progresses; detects conflicting translations and surfaces them for resolution\n- **Multi-stage quality** — optional polishing (strong model), final AI review, backtranslation sampling, and cross-chapter consistency QA\n- **Resumability** — batch-level checkpoints, chapter status tracking, and atomic state writes; interrupt at any point and resume with the same command\n- **Multiple LLM providers** — DeepSeek, OpenAI, OpenRouter, Google Gemini, Ollama, vLLM, and generic OpenAI-compatible endpoints\n- **Native EPUB preservation** — writes translated text back into the original XHTML templates and attempts to preserve styles, images, TOC, and anchors\n- **Bilingual output** — optional source-and-translation edition with visually subdued source text, including dark mode support\n\n---\n\n## Quick start\n\n### Prerequisites\n\nWenyi requires Python 3.10+ and [uv](https://docs.astral.sh/uv/).\n\n### Installation\n\n```bash\ngit clone https://github.com/BigDawnGhost/wenyi.git\ncd wenyi\nuv sync\n```\n\n### Configuration\n\nSet your API key:\n\n```bash\nexport DEEPSEEK_API_KEY=sk-...\n```\n\n### One-command translation\n\n```bash\nuv run trans-novel translate book.epub\n```\n\nThis parses the book, detects the source language, prescans for understanding, translates all chapters, and assembles the output. The monolingual Chinese EPUB is written to `output/book.zh.epub` by default.\n\n### Step-by-step workflow\n\n```bash\n# 1. Prepare — parse, analyze, prescan (no body text translated)\nuv run trans-novel prepare book.epub\n\n# 2. Translate — resume from the prepared state\nuv run trans-novel translate book.epub\n\n# 3. Review — independent final review against the completed glossary\nuv run trans-novel review book.epub\n\n# 4. Consistency QA\nuv run trans-novel qa book.epub\n\n# 5. Check progress\nuv run trans-novel status book.epub\n```\n\n### Interrupt and resume\n\nEvery completed batch is persisted immediately. If a run is interrupted, execute the same command again:\n\n```bash\nuv run trans-novel translate book.epub\n```\n\n### Command-line overrides\n\n```bash\nuv run trans-novel translate book.epub --polish --review --qa # enable all quality stages\nuv run trans-novel translate book.epub --no-polish # disable polishing\nuv run trans-novel translate book.epub --bilingual # produce both editions\nuv run trans-novel translate book.epub --chapter 0 # translate the first chapter (indices start at 0)\nuv run trans-novel translate book.epub --format txt # export as plain text\n```\n\n---\n\n## Supported formats\n\n| Input | Output |\n|---|---|\n| EPUB, FB2, TXT, Markdown, HTML, PDF | EPUB (monolingual / bilingual), TXT, HTML, Markdown |\n\n- PDF input requires `MINERU_API_KEY` for the initial conversion; the resulting HTML is cached and reused.\n- EPUB output attempts to preserve the original book's styles, images, table of contents, and anchors. Vertical layout is converted to horizontal for Chinese reading.\n- Source language is auto-detected by default, or fixed to an ISO 639-1 code in `config.yaml`.\n\n---\n\n## Translation pipeline\n\n```mermaid\nflowchart TD\n A[Input file] --> B[Parse chapters and detect language]\n B --> C[Analyze style and seed the glossary]\n C --> D[Optional parallel prescan<br/>Chapter digests and book synopsis]\n D --> E\n\n subgraph T[Translate chapter by chapter]\n E[Inject context and translate a batch]\n E --> F[Polish and persist translations]\n F --> G[Extract terms and refresh the glossary]\n G --> H{More batches?}\n H -- Yes --> E\n H -- No --> I[Normalize punctuation and run chapter-level term extraction]\n I --> J[Check backtranslation samples and persist the final chapter]\n end\n\n J --> K[Optional parallel final review<br/>Using the completed glossary]\n K --> L[Optional cross-chapter consistency QA]\n L --> M[Generate the report and assemble the selected output]\n```\n\nWhen enabled, the prescan runs in parallel with configurable concurrency and is idempotent — completed digests are reused across runs. During translation, each batch receives the most recent glossary snapshot and translated context, keeping pronouns, terms, and tone consistent across chapters.\n\n---\n\n## Documentation\n\n- [Usage guide](docs/usage.md) — installation, Windows setup, input/output, resumability, independent stages\n- [Configuration](docs/configuration.md) — providers, languages, pipeline switches, segmentation, paths\n- [Translation pipeline](docs/pipeline.md) — whole-book analysis, terminology, context, polishing, review\n- [Contributing](CONTRIBUTING.md) — development, testing, and contribution guidelines\n\nTranslated state directories for public-domain books may be shared through [wenyi-bookcase](https://github.com/BigDawnGhost/wenyi-bookcase). Do not publish copyrighted text, private books, or `state/` directories containing sensitive information without permission.\n\n---\n\n## Limitations\n\n- The translation pipeline is optimized for Simplified Chinese output; other target languages are not supported.\n- Polishing and final review are the most expensive stages — they significantly increase token consumption.\n- PDF input depends on the MinerU external service; the initial conversion requires an API key.\n- Translation quality is bounded by the capabilities of the chosen LLM model.\n- Very long books may produce large state directories; storage requirements grow with book length.\n\n---\n\n## Community\n\n- [Discord server](https://discord.gg/Tybfva4HT)\n- QQ group: 1055065098\n- [GitHub Issues](https://github.com/BigDawnGhost/wenyi/issues) — bug reports and feature requests\n- [GitHub Discussions](https://github.com/BigDawnGhost/wenyi/discussions) — ideas and questions\n\n---\n\n## Star history\n\n<a href=\"https://www.star-history.com/?repos=BigDawnGhost%2FWenyi&type=date&legend=top-left\">\n <picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&theme=dark&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <source media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <img alt=\"Star History Chart\" src=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n </picture>\n</a>\n\n---\n\n## License\n\n[MIT](LICENSE)\n"}, "31da1a33ef3b648ea9616479a816a85803eb0409": {"t": 1785748685.822774, "n": 9322, "h": "bfa2d8d50c3b4ba4", "c": "<div align=\"center\">\n\n# 📚 Wenyi (文译)\n\n**One command, from EPUB to a readable Chinese translation.**\n\nWhole-book analysis · Real-time glossary · Multi-stage review\n\n[](https://www.python.org/)\n[](https://github.com/BigDawnGhost/wenyi/actions/workflows/tests.yml)\n[](LICENSE)\n[](https://github.com/BigDawnGhost/wenyi/stargazers)\n[](https://discord.gg/Tybfva4HT)\n\n**English** | [简体中文](docs/zh/README.md)\n\n<img src=\"docs/images/bilingual-preview.png\" alt=\"Wenyi bilingual EPUB preview\" width=\"720\">\n\n</div>\n\n---\n\n## Table of contents\n\n- [Why Wenyi](#why-wenyi)\n- [Core features](#core-features)\n- [Quick start](#quick-start)\n- [Supported formats](#supported-formats)\n- [Translation pipeline](#translation-pipeline)\n- [Documentation](#documentation)\n- [Limitations](#limitations)\n- [Community](#community)\n- [Star history](#star-history)\n- [License](#license)\n\n---\n\n## Why Wenyi\n\n| Typical approach | Wenyi |\n|---|---|\n| Segments translated in isolation, unaware of surrounding content | Whole-book prescan with chapter digests and rolling context |\n| Glossary managed manually or as an afterthought | Real-time term extraction with conflict detection, fed back into subsequent batches |\n| Single-pass translation, fragile to interruptions | Batch checkpoints and chapter status tracking: resume any interrupted run with the same command |\n| Raw model output, no systematic quality process | Translate → polish → chapter-level backtranslation sampling → final review → consistency QA |\n\nWenyi is designed for **long-form texts** — novels, social-science monographs, narrative nonfiction, and more.\n\n---\n\n## Core features\n\n- **Whole-book understanding** — prescans the source before translation, creating per-chapter digests and a book-level synopsis injected into every batch\n- **Real-time glossary** — extracts proper names, terms, and recurring expressions as translation progresses; detects conflicting translations and surfaces them for resolution\n- **Multi-stage quality** — optional polishing (strong model), final AI review, backtranslation sampling, and cross-chapter consistency QA\n- **Resumability** — batch-level checkpoints, chapter status tracking, and atomic state writes; interrupt at any point and resume with the same command\n- **Multiple LLM providers** — DeepSeek, OpenAI, OpenRouter, Google Gemini, Ollama, vLLM, and generic OpenAI-compatible endpoints\n- **Native EPUB preservation** — writes translated text back into the original XHTML templates and attempts to preserve styles, images, TOC, and anchors\n- **Bilingual output** — optional source-and-translation edition with visually subdued source text, including dark mode support\n\n---\n\n## Quick start\n\n### Prerequisites\n\nWenyi requires Python 3.10+ and [uv](https://docs.astral.sh/uv/).\n\n### Installation\n\n```bash\ngit clone https://github.com/BigDawnGhost/wenyi.git\ncd wenyi\nuv sync\n```\n\n### Configuration\n\nSet your API key:\n\n```bash\nexport DEEPSEEK_API_KEY=sk-...\n```\n\n### One-command translation\n\n```bash\nuv run trans-novel translate book.epub\n```\n\nThis parses the book, detects the source language, prescans for understanding, translates all chapters, and assembles the output. The monolingual Chinese EPUB is written to `output/book.zh.epub` by default.\n\n### Step-by-step workflow\n\n```bash\n# 1. Prepare — parse, analyze, prescan (no body text translated)\nuv run trans-novel prepare book.epub\n\n# 2. Translate — resume from the prepared state\nuv run trans-novel translate book.epub\n\n# 3. Review — independent final review against the completed glossary\nuv run trans-novel review book.epub\n\n# 4. Consistency QA\nuv run trans-novel qa book.epub\n\n# 5. Check progress\nuv run trans-novel status book.epub\n```\n\n### Interrupt and resume\n\nEvery completed batch is persisted immediately. If a run is interrupted, execute the same command again:\n\n```bash\nuv run trans-novel translate book.epub\n```\n\n### Command-line overrides\n\n```bash\nuv run trans-novel translate book.epub --polish --review --qa # enable all quality stages\nuv run trans-novel translate book.epub --no-polish # disable polishing\nuv run trans-novel translate book.epub --bilingual # produce both editions\nuv run trans-novel translate book.epub --chapter 0 # translate the first chapter (indices start at 0)\nuv run trans-novel translate book.epub --format txt # export as plain text\n```\n\n---\n\n## Supported formats\n\n| Input | Output |\n|---|---|\n| EPUB, FB2, TXT, Markdown, HTML, PDF | EPUB (monolingual / bilingual), TXT, HTML, Markdown |\n\n- PDF input requires `MINERU_API_KEY` for the initial conversion; the resulting HTML is cached and reused.\n- EPUB output attempts to preserve the original book's styles, images, table of contents, and anchors. Vertical layout is converted to horizontal for Chinese reading.\n- Source language is auto-detected by default, or fixed to an ISO 639-1 code in `config.yaml`.\n\n---\n\n## Translation pipeline\n\n```mermaid\nflowchart TD\n A[Input file] --> B[Parse chapters and detect language]\n B --> C[Analyze style and seed the glossary]\n C --> D[Optional parallel prescan<br/>Chapter digests and book synopsis]\n D --> E\n\n subgraph T[Translate chapter by chapter]\n E[Inject context and translate a batch]\n E --> F[Polish and persist translations]\n F --> G[Extract terms and refresh the glossary]\n G --> H{More batches?}\n H -- Yes --> E\n H -- No --> I[Normalize punctuation and run chapter-level term extraction]\n I --> J[Check backtranslation samples and persist the final chapter]\n end\n\n J --> K[Optional parallel final review<br/>Using the completed glossary]\n K --> L[Optional cross-chapter consistency QA]\n L --> M[Generate the report and assemble the selected output]\n```\n\nWhen enabled, the prescan runs in parallel with configurable concurrency and is idempotent — completed digests are reused across runs. During translation, each batch receives the most recent glossary snapshot and translated context, keeping pronouns, terms, and tone consistent across chapters.\n\n---\n\n## Documentation\n\n- [Usage guide](docs/usage.md) — installation, Windows setup, input/output, resumability, independent stages\n- [Configuration](docs/configuration.md) — providers, languages, pipeline switches, segmentation, paths\n- [Translation pipeline](docs/pipeline.md) — whole-book analysis, terminology, context, polishing, review\n- [Contributing](CONTRIBUTING.md) — development, testing, and contribution guidelines\n\nTranslated state directories for public-domain books may be shared through [wenyi-bookcase](https://github.com/BigDawnGhost/wenyi-bookcase). Do not publish copyrighted text, private books, or `state/` directories containing sensitive information without permission.\n\n---\n\n## Limitations\n\n- The translation pipeline is optimized for Simplified Chinese output; other target languages are not supported.\n- Polishing and final review are the most expensive stages — they significantly increase token consumption.\n- PDF input depends on the MinerU external service; the initial conversion requires an API key.\n- Translation quality is bounded by the capabilities of the chosen LLM model.\n- Very long books may produce large state directories; storage requirements grow with book length.\n\n---\n\n## Community\n\n- [Discord server](https://discord.gg/Tybfva4HT)\n- QQ group: 1055065098\n- [GitHub Issues](https://github.com/BigDawnGhost/wenyi/issues) — bug reports and feature requests\n- [GitHub Discussions](https://github.com/BigDawnGhost/wenyi/discussions) — ideas and questions\n\n---\n\n## Star history\n\n<details>\n<summary>Click to expand the star history chart</summary>\n<br>\n\n<a href=\"https://www.star-history.com/?repos=BigDawnGhost%2FWenyi&type=date&legend=top-left\">\n <picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&theme=dark&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <source media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <img alt=\"Star History Chart\" src=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n </picture>\n</a>\n\n</details>\n\n---\n\n## License\n\n[MIT](LICENSE)\n"}, "609a4424bbf9d6f081b6e2fc4afd606408fa567c": {"t": 1785748686.937505, "n": 9193, "h": "8d9fdded761ccdca", "c": "<div align=\"center\">\n\n# 📚 Wenyi (文译)\n\n**One command, from EPUB to a readable Chinese translation.**\n\nWhole-book analysis · Real-time glossary · Multi-stage review\n\n[](https://www.python.org/)\n[](https://github.com/BigDawnGhost/wenyi/actions/workflows/tests.yml)\n[](LICENSE)\n[](https://github.com/BigDawnGhost/wenyi/stargazers)\n[](https://discord.gg/Tybfva4HT)\n\n**English** | [简体中文](docs/zh/README.md)\n\n<img src=\"docs/images/bilingual-preview.png\" alt=\"Wenyi bilingual EPUB preview\" width=\"720\">\n\n</div>\n\n---\n\n## Table of contents\n\n- [Why Wenyi](#why-wenyi)\n- [Core features](#core-features)\n- [Quick start](#quick-start)\n- [Supported formats](#supported-formats)\n- [Translation pipeline](#translation-pipeline)\n- [Documentation](#documentation)\n- [Limitations](#limitations)\n- [Community](#community)\n- [Star history](#star-history)\n- [License](#license)\n\n---\n\n## Why Wenyi\n\n| Typical approach | Wenyi |\n|---|---|\n| Segments translated in isolation, unaware of surrounding content | Whole-book prescan with chapter digests and rolling context |\n| Glossary managed manually or as an afterthought | Real-time term extraction with conflict detection, fed back into subsequent batches |\n| Single-pass translation, fragile to interruptions | Chapter-level state machine: resume any interrupted run with the same command |\n| Raw model output, no systematic quality process | Translate → polish → review → backtranslate → consistency QA |\n\nWenyi is designed for **long-form texts** — novels, memoirs, biographies — where translating a sentence in chapter 3 demands knowledge of chapter 1, and a character's name must remain consistent across 500 pages.\n\n---\n\n## Core features\n\n- **Whole-book understanding** — prescans the source before translation, creating per-chapter digests and a book-level synopsis injected into every batch\n- **Real-time glossary** — extracts proper names, terms, and recurring expressions as translation progresses; detects conflicting translations and surfaces them for resolution\n- **Multi-stage quality** — optional polishing (strong model), side-by-side review, backtranslation sampling, and cross-chapter consistency QA\n- **Resumability** — chapter-level state machine with atomic writes; interrupt at any point and resume with the same command\n- **Multiple LLM providers** — DeepSeek, OpenAI, OpenRouter, Google Gemini, Ollama, vLLM, and generic OpenAI-compatible endpoints\n- **Native EPUB preservation** — writes translated text back into the original XHTML templates, preserving styles, images, TOC, and anchors\n- **Bilingual output** — optional side-by-side edition with visually subdued source text, including dark mode support\n\n---\n\n## Quick start\n\n### Prerequisites\n\nWenyi requires Python 3.10+ and [uv](https://docs.astral.sh/uv/).\n\n### Installation\n\n```bash\ngit clone git@github.com:BigDawnGhost/wenyi.git\ncd wenyi\nuv sync\n```\n\n### Configuration\n\nSet your API key and optionally review the generated config file:\n\n```bash\nexport DEEPSEEK_API_KEY=sk-...\n# config.yaml is auto-created on first run if missing\n```\n\n### One-command translation\n\n```bash\nuv run trans-novel translate book.epub\n```\n\nThis parses the book, detects the source language, prescans for understanding, translates all chapters, and assembles the output. The monolingual Chinese EPUB is written to `output/book.zh.epub` by default.\n\n### Step-by-step workflow\n\n```bash\n# 1. Prepare — parse, analyze, prescan (no body text translated)\nuv run trans-novel prepare book.epub\n\n# 2. Translate — resume from the prepared state\nuv run trans-novel translate book.epub\n\n# 3. Review — independent final review against the completed glossary\nuv run trans-novel review book.epub\n\n# 4. Consistency QA\nuv run trans-novel qa book.epub\n\n# 5. Check progress\nuv run trans-novel status book.epub\n```\n\n### Interrupt and resume\n\nEvery completed batch is persisted immediately. If a run is interrupted, execute the same command again:\n\n```bash\nuv run trans-novel translate book.epub\n```\n\n### Command-line overrides\n\n```bash\nuv run trans-novel translate book.epub --polish --review --qa # enable all quality stages\nuv run trans-novel translate book.epub --no-polish # disable polishing\nuv run trans-novel translate book.epub --bilingual # produce both editions\nuv run trans-novel translate book.epub --chapter 3 # translate a single chapter\nuv run trans-novel translate book.epub --format txt # export as plain text\n```\n\n---\n\n## Supported formats\n\n| Input | Output |\n|---|---|\n| EPUB, FB2, TXT, Markdown, HTML, PDF | EPUB (monolingual / bilingual), TXT, HTML, Markdown |\n\n- PDF input requires `MINERU_API_KEY` for the initial conversion; the resulting HTML is cached and reused.\n- EPUB output preserves the original book's styles, images, table of contents, and anchors. Vertical layout is converted to horizontal for Chinese reading.\n- Source language is auto-detected by default, or fixed to an ISO 639-1 code in `config.yaml`.\n\n---\n\n## Translation pipeline\n\n```\n Input file\n ↓\n Parse chapters + detect language\n ↓\n Whole-book prescan (chapter digests + synopsis) ← parallel\n ↓\n Style analysis + initial glossary\n ↓\n ┌─ Translate chapter by chapter ──────────────────────┐\n │ Per batch: inject context → translate │\n │ → extract terms → polish → normalize punctuation │\n │ → backtranslate sample → persist │\n └──────────────────────────────────────────────────────┘\n ↓\n Final review (against completed glossary) ← optional, parallel\n ↓\n Cross-chapter consistency QA ← optional\n ↓\n Generate report + assemble output EPUB\n```\n\nThe prescan runs in parallel (configurable concurrency) and is idempotent — completed digests are reused across runs. During translation, each batch receives the most recent glossary snapshot and translated context, keeping pronouns, terms, and tone consistent across chapters.\n\n---\n\n## Documentation\n\n- [Usage guide](docs/usage.md) — installation, Windows setup, input/output, resumability, independent stages\n- [Configuration](docs/configuration.md) — providers, languages, pipeline switches, segmentation, paths\n- [Translation pipeline](docs/pipeline.md) — whole-book analysis, terminology, context, polishing, review\n- [Contributing](CONTRIBUTING.md) — development, testing, and contribution guidelines\n\nTranslated state directories for public-domain books may be shared through [wenyi-bookcase](https://github.com/BigDawnGhost/wenyi-bookcase). Do not publish copyrighted text, private books, or `state/` directories containing sensitive information without permission.\n\n---\n\n## Limitations\n\n- The translation pipeline is optimized for Simplified Chinese output; other target languages are not supported.\n- Polishing and final review are the most expensive stages — they significantly increase token consumption.\n- PDF input depends on the MinerU external service; the initial conversion requires an API key.\n- Translation quality is bounded by the capabilities of the chosen LLM model.\n- Very long books may produce large state directories; storage requirements grow with book length.\n\n---\n\n## Community\n\n- [Discord server](https://discord.gg/Tybfva4HT)\n- QQ group: 1055065098\n- [GitHub Issues](https://github.com/BigDawnGhost/wenyi/issues) — bug reports and feature requests\n- [GitHub Discussions](https://github.com/BigDawnGhost/wenyi/discussions) — ideas and questions\n\n---\n\n## Star history\n\n<details>\n<summary>Click to expand the star history chart</summary>\n<br>\n\n<a href=\"https://www.star-history.com/?repos=BigDawnGhost%2FWenyi&type=date&legend=top-left\">\n <picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&theme=dark&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <source media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <img alt=\"Star History Chart\" src=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n </picture>\n</a>\n\n</details>\n\n---\n\n## License\n\n[MIT](LICENSE)\n"}, "6cb2234a6bbe7827a4e5709fd4ae783e894fbdb6": {"t": 1785748688.0486922, "n": 9475, "h": "c45a3cfce3ae33b6", "c": "<div align=\"center\">\n\n# 📚 Wenyi (文译)\n\n**One command, from EPUB to a readable Chinese translation.**\n\nWhole-book analysis · Real-time glossary · Multi-stage review\n\n[](https://www.python.org/)\n[](https://github.com/BigDawnGhost/wenyi/actions/workflows/tests.yml)\n[](LICENSE)\n[](https://github.com/BigDawnGhost/wenyi/stargazers)\n[](CONTRIBUTING.md)\n[](https://discord.gg/Tybfva4HT)\n\n**English** | [简体中文](docs/zh/README.md)\n\n<img src=\"docs/images/bilingual-preview.png\" alt=\"Wenyi bilingual EPUB preview\" width=\"720\">\n\n</div>\n\n---\n\n## 🧭 Table of contents\n\n- [🤔 Why Wenyi](#why-wenyi)\n- [✨ Core features](#core-features)\n- [🚀 Quick start](#quick-start)\n- [📂 Supported formats](#supported-formats)\n- [🔄 Translation pipeline](#translation-pipeline)\n- [📖 Documentation](#documentation)\n- [⚠️ Limitations](#limitations)\n- [🤝 Community](#community)\n- [⭐ Star history](#star-history)\n- [📄 License](#license)\n\n---\n\n## 🤔 Why Wenyi\n\n| Typical approach | Wenyi |\n|---|---|\n| Segments translated in isolation, unaware of surrounding content | Whole-book prescan with chapter digests and rolling context |\n| Glossary managed manually or as an afterthought | Real-time term extraction with conflict detection, fed back into subsequent batches |\n| Single-pass translation, fragile to interruptions | Chapter-level state machine: resume any interrupted run with the same command |\n| Raw model output, no systematic quality process | Translate → polish → review → backtranslate → consistency QA |\n\nWenyi is designed for **long-form texts** — novels, memoirs, biographies — where translating a sentence in chapter 3 demands knowledge of chapter 1, and a character's name must remain consistent across 500 pages. 📖✨\n\n---\n\n## ✨ Core features\n\n- 📖 **Whole-book understanding** — prescans the source before translation, creating per-chapter digests and a book-level synopsis injected into every batch\n- 🔤 **Real-time glossary** — extracts proper names, terms, and recurring expressions as translation progresses; detects conflicting translations and surfaces them for resolution\n- ✅ **Multi-stage quality** — optional polishing (strong model), side-by-side review, backtranslation sampling, and cross-chapter consistency QA\n- ⏯️ **Resumability** — chapter-level state machine with atomic writes; interrupt at any point and resume with the same command\n- 🤖 **Multiple LLM providers** — DeepSeek, OpenAI, OpenRouter, Google Gemini, Ollama, vLLM, and generic OpenAI-compatible endpoints\n- 🎨 **Native EPUB preservation** — writes translated text back into the original XHTML templates, preserving styles, images, TOC, and anchors\n- 🌗 **Bilingual output** — optional side-by-side edition with visually subdued source text, including dark mode support\n\n---\n\n## 🚀 Quick start\n\n### 📋 Prerequisites\n\nWenyi requires Python 3.10+ and [uv](https://docs.astral.sh/uv/).\n\n### 📦 Installation\n\n```bash\ngit clone git@github.com:BigDawnGhost/wenyi.git\ncd wenyi\nuv sync\n```\n\n### 🔑 Configuration\n\nSet your API key and optionally review the generated config file:\n\n```bash\nexport DEEPSEEK_API_KEY=sk-...\n# config.yaml is auto-created on first run if missing\n```\n\n### ⚡ One-command translation\n\n```bash\nuv run trans-novel translate book.epub\n```\n\nThis parses the book, detects the source language, prescans for understanding, translates all chapters, and assembles the output. The monolingual Chinese EPUB is written to `output/book.zh.epub` by default.\n\n### 🪜 Step-by-step workflow\n\n```bash\n# 1. Prepare — parse, analyze, prescan (no body text translated)\nuv run trans-novel prepare book.epub\n\n# 2. Translate — resume from the prepared state\nuv run trans-novel translate book.epub\n\n# 3. Review — independent final review against the completed glossary\nuv run trans-novel review book.epub\n\n# 4. Consistency QA\nuv run trans-novel qa book.epub\n\n# 5. Check progress\nuv run trans-novel status book.epub\n```\n\n### ⏯️ Interrupt and resume\n\nEvery completed batch is persisted immediately. If a run is interrupted, execute the same command again:\n\n```bash\nuv run trans-novel translate book.epub\n```\n\n### 🎛️ Command-line overrides\n\n```bash\nuv run trans-novel translate book.epub --polish --review --qa # enable all quality stages\nuv run trans-novel translate book.epub --no-polish # disable polishing\nuv run trans-novel translate book.epub --bilingual # produce both editions\nuv run trans-novel translate book.epub --chapter 3 # translate a single chapter\nuv run trans-novel translate book.epub --format txt # export as plain text\n```\n\n---\n\n## 📂 Supported formats\n\n| Input | Output |\n|---|---|\n| EPUB, FB2, TXT, Markdown, HTML, PDF | EPUB (monolingual / bilingual), TXT, HTML, Markdown |\n\n- 📑 PDF input requires `MINERU_API_KEY` for the initial conversion; the resulting HTML is cached and reused.\n- 🖼️ EPUB output preserves the original book's styles, images, table of contents, and anchors. Vertical layout is converted to horizontal for Chinese reading.\n- 🌐 Source language is auto-detected by default, or fixed to an ISO 639-1 code in `config.yaml`.\n\n---\n\n## 🔄 Translation pipeline\n\n```mermaid\nflowchart TD\n A[\"📄 Input file\"] --> B[\"🔍 Parse chapters + detect language\"]\n B --> C[\"📖 Whole-book prescan<br/>chapter digests + synopsis\"]\n C --> D[\"🎨 Style analysis + initial glossary\"]\n D --> LOOP\n subgraph LOOP[\"🔁 Chapter-by-chapter loop\"]\n direction LR\n L1[\"🧩 Inject context\"] --> L2[\"✍️ Translate\"] --> L3[\"🔤 Extract terms\"] --> L4[\"✨ Polish\"] --> L5[\"✒️ Normalize punctuation\"] --> L6[\"🔄 Backtranslate sample\"] --> L7[\"💾 Persist\"]\n end\n LOOP --> F[\"🧐 Final review (optional, parallel)\"]\n F --> G[\"🧪 Consistency QA (optional)\"]\n G --> H[\"📦 Report + assemble EPUB\"]\n```\n\nThe prescan runs in parallel (configurable concurrency) and is idempotent — completed digests are reused across runs. During translation, each batch receives the most recent glossary snapshot and translated context, keeping pronouns, terms, and tone consistent across chapters. 🔁\n\n---\n\n## 📖 Documentation\n\n- 📘 [Usage guide](docs/usage.md) — installation, Windows setup, input/output, resumability, independent stages\n- ⚙️ [Configuration](docs/configuration.md) — providers, languages, pipeline switches, segmentation, paths\n- 🔄 [Translation pipeline](docs/pipeline.md) — whole-book analysis, terminology, context, polishing, review\n- 🛠️ [Contributing](CONTRIBUTING.md) — development, testing, and contribution guidelines\n\nTranslated state directories for public-domain books may be shared through [wenyi-bookcase](https://github.com/BigDawnGhost/wenyi-bookcase). 🚨 Do not publish copyrighted text, private books, or `state/` directories containing sensitive information without permission.\n\n---\n\n## ⚠️ Limitations\n\n- 🎯 The translation pipeline is optimized for Simplified Chinese output; other target languages are not supported.\n- 💰 Polishing and final review are the most expensive stages — they significantly increase token consumption.\n- 📑 PDF input depends on the MinerU external service; the initial conversion requires an API key.\n- 🤖 Translation quality is bounded by the capabilities of the chosen LLM model.\n- 💾 Very long books may produce large state directories; storage requirements grow with book length.\n\n---\n\n## 🤝 Community\n\n- 💬 [Discord server](https://discord.gg/Tybfva4HT)\n- 🐧 QQ group: 1055065098\n- 🐛 [GitHub Issues](https://github.com/BigDawnGhost/wenyi/issues) — bug reports and feature requests\n- 💡 [GitHub Discussions](https://github.com/BigDawnGhost/wenyi/discussions) — ideas and questions\n\n---\n\n## ⭐ Star history\n\n<details>\n<summary>📈 Click to expand the star history chart</summary>\n<br>\n\n<a href=\"https://www.star-history.com/?repos=BigDawnGhost%2FWenyi&type=date&legend=top-left\">\n <picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&theme=dark&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <source media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <img alt=\"Star History Chart\" src=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n </picture>\n</a>\n\n</details>\n\n---\n\n## 📄 License\n\n[MIT](LICENSE)\n\n---\n\n<div align=\"center\">\n\nEnjoying Wenyi? Give it a ⭐ to support the project!\n\n</div>\n"}, "9cfb0aab047afb06b514838fd6cdf90d176b1add": {"t": 1785748689.2116606, "n": 8759, "h": "b9a4e2929c3c169a", "c": "# Wenyi (文译)\n\n[](https://www.python.org/)\n[](LICENSE)\n[](https://github.com/BigDawnGhost/wenyi)\n\n**English** | [简体中文](docs/zh/README.md)\n\n\n\n> A command-line tool for translating long-form novels from multiple languages into Chinese.\n> Whole-book analysis, real-time glossary, multi-stage review — one command, from EPUB to a readable Chinese translation.\n\n---\n\n## Table of contents\n\n- [Why Wenyi](#why-wenyi)\n- [Core features](#core-features)\n- [Quick start](#quick-start)\n- [Supported formats](#supported-formats)\n- [Translation pipeline](#translation-pipeline)\n- [Documentation](#documentation)\n- [Limitations](#limitations)\n- [Community](#community)\n- [Star history](#star-history)\n- [License](#license)\n\n---\n\n## Why Wenyi\n\n| Typical approach | Wenyi |\n|---|---|\n| Segments translated in isolation, unaware of surrounding content | Whole-book prescan with chapter digests and rolling context |\n| Glossary managed manually or as an afterthought | Real-time term extraction with conflict detection, fed back into subsequent batches |\n| Single-pass translation, fragile to interruptions | Chapter-level state machine: resume any interrupted run with the same command |\n| Raw model output, no systematic quality process | Translate → polish → review → backtranslate → consistency QA |\n\nWenyi is designed for **long-form texts** — novels, memoirs, biographies — where translating a sentence in chapter 3 demands knowledge of chapter 1, and a character's name must remain consistent across 500 pages.\n\n---\n\n## Core features\n\n- **Whole-book understanding** — prescans the source before translation, creating per-chapter digests and a book-level synopsis injected into every batch\n- **Real-time glossary** — extracts proper names, terms, and recurring expressions as translation progresses; detects conflicting translations and surfaces them for resolution\n- **Multi-stage quality** — optional polishing (strong model), side-by-side review, backtranslation sampling, and cross-chapter consistency QA\n- **Resumability** — chapter-level state machine with atomic writes; interrupt at any point and resume with the same command\n- **8 LLM providers** — DeepSeek, OpenAI, OpenRouter, Google Gemini, Ollama, vLLM, and generic OpenAI-compatible endpoints\n- **Native EPUB preservation** — writes translated text back into the original XHTML templates, preserving styles, images, TOC, and anchors\n- **Bilingual output** — optional side-by-side edition with visually subdued source text, including dark mode support\n\n---\n\n## Quick start\n\n### Prerequisites\n\nWenyi requires Python 3.10+ and [uv](https://docs.astral.sh/uv/).\n\n### Installation\n\n```bash\ngit clone git@github.com:BigDawnGhost/wenyi.git\ncd wenyi\nuv sync\n```\n\n### Configuration\n\nSet your API key and optionally review the generated config file:\n\n```bash\nexport DEEPSEEK_API_KEY=sk-...\n# config.yaml is auto-created on first run if missing\n```\n\n### One-command translation\n\n```bash\nuv run trans-novel translate book.epub\n```\n\nThis parses the book, detects the source language, prescans for understanding, translates all chapters, and assembles the output. The monolingual Chinese EPUB is written to `output/book.zh.epub` by default.\n\n### Step-by-step workflow\n\n```bash\n# 1. Prepare — parse, analyze, prescan (no body text translated)\nuv run trans-novel prepare book.epub\n\n# 2. Translate — resume from the prepared state\nuv run trans-novel translate book.epub\n\n# 3. Review — independent final review against the completed glossary\nuv run trans-novel review book.epub\n\n# 4. Consistency QA\nuv run trans-novel qa book.epub\n\n# 5. Check progress\nuv run trans-novel status book.epub\n```\n\n### Interrupt and resume\n\nEvery completed batch is persisted immediately. If a run is interrupted, execute the same command again:\n\n```bash\nuv run trans-novel translate book.epub\n```\n\n### Command-line overrides\n\n```bash\nuv run trans-novel translate book.epub --polish --review --qa # enable all quality stages\nuv run trans-novel translate book.epub --no-polish # disable polishing\nuv run trans-novel translate book.epub --bilingual # produce both editions\nuv run trans-novel translate book.epub --chapter 3 # translate a single chapter\nuv run trans-novel translate book.epub --format txt # export as plain text\n```\n\n---\n\n## Supported formats\n\n| Input | Output |\n|---|---|\n| EPUB, FB2, TXT, Markdown, HTML, PDF | EPUB (monolingual / bilingual), TXT, HTML, Markdown |\n\n- PDF input requires `MINERU_API_KEY` for the initial conversion; the resulting HTML is cached and reused.\n- EPUB output preserves the original book's styles, images, table of contents, and anchors. Vertical layout is converted to horizontal for Chinese reading.\n- Source language is auto-detected by default, or fixed to an ISO 639-1 code in `config.yaml`.\n\n---\n\n## Translation pipeline\n\n```\n Input file\n ↓\n Parse chapters + detect language\n ↓\n Whole-book prescan (chapter digests + synopsis) ← parallel\n ↓\n Style analysis + initial glossary\n ↓\n ┌─ Translate chapter by chapter ──────────────────────┐\n │ Per batch: inject context → translate │\n │ → extract terms → polish → normalize punctuation │\n │ → backtranslate sample → persist │\n └──────────────────────────────────────────────────────┘\n ↓\n Final review (against completed glossary) ← optional, parallel\n ↓\n Cross-chapter consistency QA ← optional\n ↓\n Generate report + assemble output EPUB\n```\n\nThe prescan runs in parallel (configurable concurrency) and is idempotent — completed digests are reused across runs. During translation, each batch receives the most recent glossary snapshot and translated context, keeping pronouns, terms, and tone consistent across chapters.\n\n---\n\n## Documentation\n\n- [Usage guide](docs/usage.md) — installation, Windows setup, input/output, resumability, independent stages\n- [Configuration](docs/configuration.md) — providers, languages, pipeline switches, segmentation, paths\n- [Translation pipeline](docs/pipeline.md) — whole-book analysis, terminology, context, polishing, review\n- [Contributing](CONTRIBUTING.md) — development, testing, and contribution guidelines\n\nTranslated state directories for public-domain books may be shared through [wenyi-bookcase](https://github.com/BigDawnGhost/wenyi-bookcase). Do not publish copyrighted text, private books, or `state/` directories containing sensitive information without permission.\n\n---\n\n## Limitations\n\n- The translation pipeline is optimized for Simplified Chinese output; other target languages are not supported.\n- Polishing and final review are the most expensive stages — they significantly increase token consumption.\n- PDF input depends on the MinerU external service; the initial conversion requires an API key.\n- Translation quality is bounded by the capabilities of the chosen LLM model.\n- Very long books may produce large state directories; storage requirements grow with book length.\n\n---\n\n## Community\n\n- [Discord server](https://discord.gg/Tybfva4HT)\n- QQ group: 1055065098\n- [GitHub Issues](https://github.com/BigDawnGhost/wenyi/issues) — bug reports and feature requests\n- [GitHub Discussions](https://github.com/BigDawnGhost/wenyi/discussions) — ideas and questions\n\n---\n\n## Star history\n\n<a href=\"https://www.star-history.com/?repos=BigDawnGhost%2FWenyi&type=date&legend=top-left\">\n <picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&theme=dark&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <source media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <img alt=\"Star History Chart\" src=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n </picture>\n</a>\n\n---\n\n## License\n\n[MIT](LICENSE)"}, "d474cc814b8e3c4806bc9f64f37d37473e5fae11": {"t": 1785748690.2992554, "n": 5238, "h": "17a2f87ebb6ebef3", "c": "# Wenyi\n\n**English** | [简体中文](docs/zh/README.md)\n\n\n\nWenyi is a command-line tool for translating EPUB, FB2, TXT, Markdown, HTML, and PDF novels from multiple languages into Chinese. It focuses on long-form translation quality through whole-book analysis, rolling context, an evolving glossary, polishing, and review stages.\n\n## Quick start\n\nWenyi requires Python 3.10+ and [uv](https://docs.astral.sh/uv/).\n\n```bash\nuv sync\nexport DEEPSEEK_API_KEY=sk-...\nuv run trans-novel translate book.epub\n```\n\nBy default, Wenyi writes a monolingual Chinese EPUB to the source file's `output/` directory as `book.zh.epub`. A bilingual source-and-translation edition can be enabled when needed. Runtime state, chapter JSON files, the glossary database, and reports are stored under `state/`. To continue an interrupted run, execute the same `translate` command again:\n\n```bash\nuv run trans-novel translate book.epub\nuv run trans-novel status book.epub\n```\n\nTo inspect the generated style guide and initial glossary before translating the body text, prepare the book first:\n\n```bash\nuv run trans-novel prepare book.epub\nuv run trans-novel translate book.epub\n```\n\nFinal review is disabled by default. Set `pipeline.review: true` to run it\nautomatically after the complete book has been translated and the glossary has\nreached its final state, or run the experimental Agent Review independently:\n\n```bash\nuv run trans-novel review book.epub\n```\n\nEach Review run starts from the beginning, checks chunks concurrently, and can\nselectively request cross-book evidence before resolving contradictory\nconsistency suggestions. It does not fix or modify formal translation state;\ncomplete traces and recommendations are written to a timestamped directory\nunder `state/<book>/debug/`.\n\n## Supported formats and output\n\n- Input: EPUB, FB2, TXT, Markdown, HTML, and PDF.\n- Output: monolingual EPUB by default, optional bilingual EPUB, or TXT, HTML, and Markdown exports.\n- PDF import: the first run uses MinerU and requires `MINERU_API_KEY`. The converted HTML is cached at `state/<book>/source/converted.html` and reused by later runs.\n- EPUB preservation: Wenyi attempts to retain the original styles, images, table of contents, and anchors while converting translated content to horizontal layout.\n- Language detection: the source language is detected automatically by default, or it can be fixed to an ISO language code in `config.yaml`.\n\nSelect output editions from the command line:\n\n```bash\nuv run trans-novel translate book.epub --bilingual # monolingual and bilingual\nuv run trans-novel translate book.epub --no-mono --bilingual # bilingual only\n```\n\nThe bilingual edition places the translation before the source text by default. Set `output.bilingual_order` to `source_first` in `config.yaml` to reverse the order.\n\n## Documentation\n\n- [Usage guide](docs/usage.md): installation, Windows setup, input/output, resumability, and independent workflow stages.\n- [Configuration](docs/configuration.md): providers, languages, pipeline switches, segmentation, and paths.\n- [Translation pipeline](docs/pipeline.md): whole-book analysis, terminology, context, polishing, review, and resumability.\n- [Contributing](CONTRIBUTING.md): development, testing, and contribution guidelines.\n\nTranslated state directories for public-domain books may be shared through [wenyi-bookcase](https://github.com/BigDawnGhost/wenyi-bookcase). Do not publish copyrighted text, private books, or `state/` directories containing sensitive information without permission.\n\n## Project status\n\nWenyi is an early-stage personal project focused on making long-form machine translation more accurate, consistent, and readable. Reports of inconsistent names, recurring expressions, omissions, formatting problems, and provider compatibility issues are welcome through GitHub Issues and Discussions. Pull requests are also appreciated.\n\nCommunity:\n\n- [Join the Wenyi Discord server](https://discord.gg/Tybfva4HT)\n- QQ group: 1055065098\n\n## Star history\n\n<a href=\"https://www.star-history.com/?repos=BigDawnGhost%2FWenyi&type=date&legend=top-left\">\n <picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&theme=dark&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <source media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <img alt=\"Star History Chart\" src=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n </picture>\n</a>\n"}, "5ecd7d1b6dc748a7a2e77baafd5d2b8f7be48e1e": {"t": 1785748691.360309, "n": 4947, "h": "6184ba5d0db368d9", "c": "# Wenyi\n\n**English** | [简体中文](docs/zh/README.md)\n\n\n\nWenyi is a command-line tool for translating EPUB, FB2, TXT, Markdown, HTML, and PDF novels from multiple languages into Chinese. It focuses on long-form translation quality through whole-book analysis, rolling context, an evolving glossary, polishing, and review stages.\n\n## Quick start\n\nWenyi requires Python 3.10+ and [uv](https://docs.astral.sh/uv/).\n\n```bash\nuv sync\nexport DEEPSEEK_API_KEY=sk-...\nuv run trans-novel translate book.epub\n```\n\nBy default, Wenyi writes a monolingual Chinese EPUB to the source file's `output/` directory as `book.zh.epub`. A bilingual source-and-translation edition can be enabled when needed. Runtime state, chapter JSON files, the glossary database, and reports are stored under `state/`. To continue an interrupted run, execute the same `translate` command again:\n\n```bash\nuv run trans-novel translate book.epub\nuv run trans-novel status book.epub\n```\n\nTo inspect the generated style guide and initial glossary before translating the body text, prepare the book first:\n\n```bash\nuv run trans-novel prepare book.epub\nuv run trans-novel translate book.epub\n```\n\nFinal review is disabled by default. Set `pipeline.review: true` to run it\nautomatically after the complete book has been translated and the glossary has\nreached its final state, or run and repeat the stage independently:\n\n```bash\nuv run trans-novel review book.epub\nuv run trans-novel review book.epub --force --fix\n```\n\n## Supported formats and output\n\n- Input: EPUB, FB2, TXT, Markdown, HTML, and PDF.\n- Output: monolingual EPUB by default, optional bilingual EPUB, or TXT, HTML, and Markdown exports.\n- PDF import: the first run uses MinerU and requires `MINERU_API_KEY`. The converted HTML is cached at `state/<book>/source/converted.html` and reused by later runs.\n- EPUB preservation: Wenyi attempts to retain the original styles, images, table of contents, and anchors while converting translated content to horizontal layout.\n- Language detection: the source language is detected automatically by default, or it can be fixed to an ISO language code in `config.yaml`.\n\nSelect output editions from the command line:\n\n```bash\nuv run trans-novel translate book.epub --bilingual # monolingual and bilingual\nuv run trans-novel translate book.epub --no-mono --bilingual # bilingual only\n```\n\nThe bilingual edition places the translation before the source text by default. Set `output.bilingual_order` to `source_first` in `config.yaml` to reverse the order.\n\n## Documentation\n\n- [Usage guide](docs/usage.md): installation, Windows setup, input/output, resumability, and independent workflow stages.\n- [Configuration](docs/configuration.md): providers, languages, pipeline switches, segmentation, and paths.\n- [Translation pipeline](docs/pipeline.md): whole-book analysis, terminology, context, polishing, review, and resumability.\n- [Contributing](CONTRIBUTING.md): development, testing, and contribution guidelines.\n\nTranslated state directories for public-domain books may be shared through [wenyi-bookcase](https://github.com/BigDawnGhost/wenyi-bookcase). Do not publish copyrighted text, private books, or `state/` directories containing sensitive information without permission.\n\n## Project status\n\nWenyi is an early-stage personal project focused on making long-form machine translation more accurate, consistent, and readable. Reports of inconsistent names, recurring expressions, omissions, formatting problems, and provider compatibility issues are welcome through GitHub Issues and Discussions. Pull requests are also appreciated.\n\nCommunity:\n\n- [Join the Wenyi Discord server](https://discord.gg/Tybfva4HT)\n- QQ group: 1055065098\n\n## Star history\n\n<a href=\"https://www.star-history.com/?repos=BigDawnGhost%2FWenyi&type=date&legend=top-left\">\n <picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&theme=dark&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <source media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <img alt=\"Star History Chart\" src=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n </picture>\n</a>\n"}, "3ae293f11635c416b5397d9401b4845d1e63ab5f": {"t": 1785748692.4553685, "n": 4683, "h": "5482e88178c7a337", "c": "# Wenyi\n\n**English** | [简体中文](docs/zh/README.md)\n\n\n\nWenyi is a command-line tool for translating EPUB, FB2, TXT, Markdown, HTML, and PDF novels from multiple languages into Chinese. It focuses on long-form translation quality through whole-book analysis, rolling context, an evolving glossary, polishing, and review stages.\n\n## Quick start\n\nWenyi requires Python 3.10+ and [uv](https://docs.astral.sh/uv/).\n\n```bash\nuv sync\nexport DEEPSEEK_API_KEY=sk-...\nuv run trans-novel translate book.epub\n```\n\nBy default, Wenyi writes a monolingual Chinese EPUB to the source file's `output/` directory as `book.zh.epub`. A bilingual source-and-translation edition can be enabled when needed. Runtime state, chapter JSON files, the glossary database, and reports are stored under `state/`. To continue an interrupted run:\n\n```bash\nuv run trans-novel resume book.epub\nuv run trans-novel status book.epub\n```\n\nFinal review is disabled by default. Set `pipeline.review: true` to run it\nautomatically after the complete book has been translated and the glossary has\nreached its final state, or run and repeat the stage independently:\n\n```bash\nuv run trans-novel review book.epub\nuv run trans-novel review book.epub --force --fix\n```\n\n## Supported formats and output\n\n- Input: EPUB, FB2, TXT, Markdown, HTML, and PDF.\n- Output: monolingual EPUB by default, optional bilingual EPUB, or TXT, HTML, and Markdown exports.\n- PDF import: the first run uses MinerU and requires `MINERU_API_KEY`. The converted HTML is cached at `state/<book>/source/converted.html` and reused by later runs.\n- EPUB preservation: Wenyi attempts to retain the original styles, images, table of contents, and anchors while converting translated content to horizontal layout.\n- Language detection: the source language is detected automatically by default, or it can be fixed to an ISO language code in `config.yaml`.\n\nSelect output editions from the command line:\n\n```bash\nuv run trans-novel translate book.epub --bilingual # monolingual and bilingual\nuv run trans-novel translate book.epub --no-mono --bilingual # bilingual only\n```\n\nThe bilingual edition places the translation before the source text by default. Set `output.bilingual_order` to `source_first` in `config.yaml` to reverse the order.\n\n## Documentation\n\n- [Usage guide](docs/usage.md): installation, Windows setup, input and output, resuming, and utility commands.\n- [Configuration](docs/configuration.md): providers, languages, pipeline switches, segmentation, and paths.\n- [Translation pipeline](docs/pipeline.md): whole-book analysis, terminology, context, polishing, review, and resumability.\n- [Contributing](CONTRIBUTING.md): development, testing, and contribution guidelines.\n\nTranslated state directories for public-domain books may be shared through [wenyi-bookcase](https://github.com/BigDawnGhost/wenyi-bookcase). Do not publish copyrighted text, private books, or `state/` directories containing sensitive information without permission.\n\n## Project status\n\nWenyi is an early-stage personal project focused on making long-form machine translation more accurate, consistent, and readable. Reports of inconsistent names, recurring expressions, omissions, formatting problems, and provider compatibility issues are welcome through GitHub Issues and Discussions. Pull requests are also appreciated.\n\nCommunity:\n\n- [Join the Wenyi Discord server](https://discord.gg/Tybfva4HT)\n- QQ group: 1055065098\n\n## Star history\n\n<a href=\"https://www.star-history.com/?repos=BigDawnGhost%2FWenyi&type=date&legend=top-left\">\n <picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&theme=dark&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <source media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <img alt=\"Star History Chart\" src=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n </picture>\n</a>\n"}, "8fa68b241226fe0d2c5dc4aca4fc42bf34cb751f": {"t": 1785748693.5640786, "n": 4698, "h": "2d7761fa7b058e4d", "c": "# Wenyi\n\n**English** | [简体中文](docs/zh/README.md)\n\n\n\nWenyi is a command-line tool for translating EPUB, FB2, TXT, Markdown, HTML, and PDF novels from multiple languages into Chinese. It focuses on long-form translation quality through whole-book analysis, rolling context, an evolving glossary, polishing, and review stages.\n\n## Quick start\n\nWenyi requires Python 3.10+ and [uv](https://docs.astral.sh/uv/).\n\n```bash\nuv sync\nexport DEEPSEEK_API_KEY=sk-...\nuv run trans-novel translate book.epub\n```\n\nBy default, Wenyi writes a monolingual Chinese EPUB to the source file's `output/` directory as `book.zh.epub`. A bilingual source-and-translation edition can be enabled when needed. Runtime state, chapter JSON files, the glossary database, and reports are stored under `state/`. To continue an interrupted run:\n\n```bash\nuv run trans-novel resume book.epub\nuv run trans-novel status book.epub\n```\n\nWith `pipeline.review: true` (the default), the one-command workflow runs a\nfinal review only after the complete book has been translated and the glossary\nhas reached its final state. You can also run or repeat that stage independently:\n\n```bash\nuv run trans-novel review book.epub\nuv run trans-novel review book.epub --force --fix\n```\n\n## Supported formats and output\n\n- Input: EPUB, FB2, TXT, Markdown, HTML, and PDF.\n- Output: monolingual EPUB by default, optional bilingual EPUB, or TXT, HTML, and Markdown exports.\n- PDF import: the first run uses MinerU and requires `MINERU_API_KEY`. The converted HTML is cached at `state/<book>/source/converted.html` and reused by later runs.\n- EPUB preservation: Wenyi attempts to retain the original styles, images, table of contents, and anchors while converting translated content to horizontal layout.\n- Language detection: the source language is detected automatically by default, or it can be fixed to an ISO language code in `config.yaml`.\n\nSelect output editions from the command line:\n\n```bash\nuv run trans-novel translate book.epub --bilingual # monolingual and bilingual\nuv run trans-novel translate book.epub --no-mono --bilingual # bilingual only\n```\n\nThe bilingual edition places the translation before the source text by default. Set `output.bilingual_order` to `source_first` in `config.yaml` to reverse the order.\n\n## Documentation\n\n- [Usage guide](docs/usage.md): installation, Windows setup, input and output, resuming, and utility commands.\n- [Configuration](docs/configuration.md): providers, languages, pipeline switches, segmentation, and paths.\n- [Translation pipeline](docs/pipeline.md): whole-book analysis, terminology, context, polishing, review, and resumability.\n- [Contributing](CONTRIBUTING.md): development, testing, and contribution guidelines.\n\nTranslated state directories for public-domain books may be shared through [wenyi-bookcase](https://github.com/BigDawnGhost/wenyi-bookcase). Do not publish copyrighted text, private books, or `state/` directories containing sensitive information without permission.\n\n## Project status\n\nWenyi is an early-stage personal project focused on making long-form machine translation more accurate, consistent, and readable. Reports of inconsistent names, recurring expressions, omissions, formatting problems, and provider compatibility issues are welcome through GitHub Issues and Discussions. Pull requests are also appreciated.\n\nCommunity:\n\n- [Join the Wenyi Discord server](https://discord.gg/Tybfva4HT)\n- QQ group: 1055065098\n\n## Star history\n\n<a href=\"https://www.star-history.com/?repos=BigDawnGhost%2FWenyi&type=date&legend=top-left\">\n <picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&theme=dark&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <source media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <img alt=\"Star History Chart\" src=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n </picture>\n</a>\n"}, "b9f459ee763ad8b3ee175fe3b88b6b145c230d29": {"t": 1785748694.6275332, "n": 4361, "h": "2acfc6e198140c75", "c": "# Wenyi\n\n**English** | [简体中文](docs/zh/README.md)\n\n\n\nWenyi is a command-line tool for translating EPUB, FB2, TXT, Markdown, HTML, and PDF novels from multiple languages into Chinese. It focuses on long-form translation quality through whole-book analysis, rolling context, an evolving glossary, polishing, and review stages.\n\n## Quick start\n\nWenyi requires Python 3.10+ and [uv](https://docs.astral.sh/uv/).\n\n```bash\nuv sync\nexport DEEPSEEK_API_KEY=sk-...\nuv run trans-novel translate book.epub\n```\n\nBy default, Wenyi writes a monolingual Chinese EPUB to the source file's `output/` directory as `book.zh.epub`. A bilingual source-and-translation edition can be enabled when needed. Runtime state, chapter JSON files, the glossary database, and reports are stored under `state/`. To continue an interrupted run:\n\n```bash\nuv run trans-novel resume book.epub\nuv run trans-novel status book.epub\n```\n\n## Supported formats and output\n\n- Input: EPUB, FB2, TXT, Markdown, HTML, and PDF.\n- Output: monolingual EPUB by default, optional bilingual EPUB, or TXT, HTML, and Markdown exports.\n- PDF import: the first run uses MinerU and requires `MINERU_API_KEY`. The converted HTML is cached at `state/<book>/source/converted.html` and reused by later runs.\n- EPUB preservation: Wenyi attempts to retain the original styles, images, table of contents, and anchors while converting translated content to horizontal layout.\n- Language detection: the source language is detected automatically by default, or it can be fixed to an ISO language code in `config.yaml`.\n\nSelect output editions from the command line:\n\n```bash\nuv run trans-novel translate book.epub --bilingual # monolingual and bilingual\nuv run trans-novel translate book.epub --no-mono --bilingual # bilingual only\n```\n\nThe bilingual edition places the translation before the source text by default. Set `output.bilingual_order` to `source_first` in `config.yaml` to reverse the order.\n\n## Documentation\n\n- [Usage guide](docs/usage.md): installation, Windows setup, input and output, resuming, and utility commands.\n- [Configuration](docs/configuration.md): providers, languages, pipeline switches, segmentation, and paths.\n- [Translation pipeline](docs/pipeline.md): whole-book analysis, terminology, context, polishing, review, and resumability.\n- [Contributing](CONTRIBUTING.md): development, testing, and contribution guidelines.\n\nTranslated state directories for public-domain books may be shared through [wenyi-bookcase](https://github.com/BigDawnGhost/wenyi-bookcase). Do not publish copyrighted text, private books, or `state/` directories containing sensitive information without permission.\n\n## Project status\n\nWenyi is an early-stage personal project focused on making long-form machine translation more accurate, consistent, and readable. Reports of inconsistent names, recurring expressions, omissions, formatting problems, and provider compatibility issues are welcome through GitHub Issues and Discussions. Pull requests are also appreciated.\n\nCommunity:\n\n- [Join the Wenyi Discord server](https://discord.gg/Tybfva4HT)\n- QQ group: 1055065098\n\n## Star history\n\n<a href=\"https://www.star-history.com/?repos=BigDawnGhost%2FWenyi&type=date&legend=top-left\">\n <picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&theme=dark&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <source media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <img alt=\"Star History Chart\" src=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n </picture>\n</a>\n"}, "0af6c9091f6bbe291b2910ff5933d886f2cf73c3": {"t": 1785748695.6923842, "n": 2767, "h": "22bd43d3d784020d", "c": "# 文译\n\n\n\n将多语言 EPUB、FB2、TXT、Markdown、HTML 和 PDF 小说翻译为中文的命令行工具。它以长篇小说的翻译质量为重点:全书预扫、滚动上下文、实时术语库、润色和审校均可按需启用。\n\n## 快速开始\n\n需要 Python 3.10+ 与 [uv](https://docs.astral.sh/uv/)。\n\n```bash\nuv sync\nexport DEEPSEEK_API_KEY=sk-...\nuv run trans-novel translate book.epub\n```\n\n翻译完成后,默认在源文件所在目录的 `output/` 中生成单语中文版 `book.zh.epub`;也可按需生成原文对照版 `book.zh-bi.epub`。运行状态、章节 JSON、术语库和报告写入 `state/`。中断后可继续:\n\n```bash\nuv run trans-novel resume book.epub\nuv run trans-novel status book.epub\n```\n\n## 支持范围\n\n- 输入:EPUB、FB2、TXT、Markdown、HTML、PDF。\n- 输出:默认生成单语 EPUB,可选双语对照版;也可导出 TXT、HTML 或 Markdown。\n- PDF:首次读取通过 MinerU 转换为 `state/<书名>/source/converted.html`,需设置 `MINERU_API_KEY`;后续运行直接复用该缓存。\n- EPUB:尽量保留原书样式、图片、目录与锚点;译文元数据默认设为简体中文,并将竖排样式转为横排。\n- 语言:默认由模型识别源语言,也可在 `config.yaml` 固定为语言代码。\n\n可通过命令行临时选择产物:\n\n```bash\nuv run trans-novel translate book.epub --bilingual # 同时生成单语版和双语版\nuv run trans-novel translate book.epub --no-mono --bilingual # 仅生成双语版\n```\n\n双语版默认译文在上、原文在下,可在 `config.yaml` 中将 `output.bilingual_order` 改为 `source_first`。\n\n## 文档\n\n- [使用指南](docs/usage.md):安装、Windows 使用、输入输出、续跑和工具命令。\n- [配置说明](docs/configuration.md):模型、源语言、流水线开关、切分与路径配置。\n- [翻译流程](docs/pipeline.md):预扫、术语、上下文、润色、审校和断点续跑如何协作。\n- [贡献指南](CONTRIBUTING.md):开发、测试和贡献要求。\n\n公版书翻译生成的状态目录可在 [wenyi-bookcase](https://github.com/BigDawnGhost/wenyi-bookcase) 查看,也欢迎提交分享;请勿提交或分享无授权的版权文本、私人书籍或包含敏感信息的 `state/` 目录。\n\n## 憧憬与不足\n\n本项目为作者个人兴趣所开发,仅在于针对长文本书籍的译介做出一份微薄的努力,未来想让翻译在够准确的前提下更加顺畅,努力从可读向好读迈进。现阶段翻译文本一些口头禅前后翻译不一致,专有名词翻译不准确的问题,已经改进!如果还有什么问题,可以提交issue,如果你有什么想法,欢迎在讨论区提出,如果你有一定的编程能力,欢迎给我提交PR,让这个项目变得更好。👏\n\n项目交流QQ群:1055065098\n\n## 星标历史\n\n<a href=\"https://www.star-history.com/?repos=BigDawnGhost%2FWenyi&type=date&legend=top-left\">\n <picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&theme=dark&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <source media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <img alt=\"Star History Chart\" src=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n </picture>\n</a>\n"}, "bf952eabf1300ced5eed592e74c3c9a512d9ac2a": {"t": 1785748696.7700472, "n": 2752, "h": "734b58af159fa52c", "c": "# 文译\n\n\n\n将多语言 EPUB、FB2、TXT、Markdown、HTML 和 PDF 小说翻译为中文的命令行工具。它以长篇小说的翻译质量为重点:全书预扫、滚动上下文、实时术语库、润色和审校均可按需启用。\n\n## 快速开始\n\n需要 Python 3.10+ 与 [uv](https://docs.astral.sh/uv/)。\n\n```bash\nuv sync\nexport DEEPSEEK_API_KEY=sk-...\nuv run trans-novel translate book.epub\n```\n\n翻译完成后,默认在源文件所在目录的 `output/` 中生成单语中文版 `book.zh.epub`;也可按需生成原文对照版 `book.zh-bi.epub`。运行状态、章节 JSON、术语库和报告写入 `state/`。中断后可继续:\n\n```bash\nuv run trans-novel resume book.epub\nuv run trans-novel status book.epub\n```\n\n## 支持范围\n\n- 输入:EPUB、FB2、TXT、Markdown、HTML、PDF。\n- 输出:默认生成单语 EPUB,可选双语对照版;也可导出 TXT、HTML 或 Markdown。\n- PDF:首次读取通过 MinerU 转换为同目录 `<文件名>.pdf.html`,需设置 `MINERU_API_KEY`;后续运行直接复用该文件。\n- EPUB:尽量保留原书样式、图片、目录与锚点;译文元数据默认设为简体中文,并将竖排样式转为横排。\n- 语言:默认由模型识别源语言,也可在 `config.yaml` 固定为语言代码。\n\n可通过命令行临时选择产物:\n\n```bash\nuv run trans-novel translate book.epub --bilingual # 同时生成单语版和双语版\nuv run trans-novel translate book.epub --no-mono --bilingual # 仅生成双语版\n```\n\n双语版默认译文在上、原文在下,可在 `config.yaml` 中将 `output.bilingual_order` 改为 `source_first`。\n\n## 文档\n\n- [使用指南](docs/usage.md):安装、Windows 使用、输入输出、续跑和工具命令。\n- [配置说明](docs/configuration.md):模型、源语言、流水线开关、切分与路径配置。\n- [翻译流程](docs/pipeline.md):预扫、术语、上下文、润色、审校和断点续跑如何协作。\n- [贡献指南](CONTRIBUTING.md):开发、测试和贡献要求。\n\n公版书翻译生成的状态目录可在 [wenyi-bookcase](https://github.com/BigDawnGhost/wenyi-bookcase) 查看,也欢迎提交分享;请勿提交或分享无授权的版权文本、私人书籍或包含敏感信息的 `state/` 目录。\n\n## 憧憬与不足\n\n本项目为作者个人兴趣所开发,仅在于针对长文本书籍的译介做出一份微薄的努力,未来想让翻译在够准确的前提下更加顺畅,努力从可读向好读迈进。现阶段翻译文本一些口头禅前后翻译不一致,专有名词翻译不准确的问题,已经改进!如果还有什么问题,可以提交issue,如果你有什么想法,欢迎在讨论区提出,如果你有一定的编程能力,欢迎给我提交PR,让这个项目变得更好。👏\n\n项目交流QQ群:1055065098\n\n## 星标历史\n\n<a href=\"https://www.star-history.com/?repos=BigDawnGhost%2FWenyi&type=date&legend=top-left\">\n <picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&theme=dark&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <source media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <img alt=\"Star History Chart\" src=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n </picture>\n</a>\n"}, "a47bae235c3c20093a0c376cdcde3c078bb3c658": {"t": 1785748697.8217382, "n": 4152, "h": "b87c2738f829d1f5", "c": "# Wenyi\n\n**English** | [简体中文](docs/zh/README.md)\n\n\n\nWenyi is a command-line tool for translating EPUB, FB2, and TXT novels from multiple languages into Chinese. It focuses on long-form translation quality through whole-book analysis, rolling context, an evolving glossary, polishing, and review stages.\n\n## Quick start\n\nWenyi requires Python 3.10+ and [uv](https://docs.astral.sh/uv/).\n\n```bash\nuv sync\nexport DEEPSEEK_API_KEY=sk-...\nuv run trans-novel translate book.epub\n```\n\nBy default, Wenyi writes a monolingual Chinese EPUB to the source file's `output/` directory as `book.zh.epub`. A bilingual source-and-translation edition can be enabled when needed. Runtime state, chapter JSON files, the glossary database, and reports are stored under `state/`. To continue an interrupted run:\n\n```bash\nuv run trans-novel resume book.epub\nuv run trans-novel status book.epub\n```\n\n## Supported formats and output\n\n- Input: EPUB, FB2, and TXT.\n- Output: monolingual EPUB by default, optional bilingual EPUB, or plain text with `--format txt`.\n- EPUB preservation: Wenyi attempts to retain the original styles, images, table of contents, and anchors while converting translated content to horizontal layout.\n- Language detection: the source language is detected automatically by default, or it can be fixed to an ISO language code in `config.yaml`.\n\nSelect output editions from the command line:\n\n```bash\nuv run trans-novel translate book.epub --bilingual # monolingual and bilingual\nuv run trans-novel translate book.epub --no-mono --bilingual # bilingual only\n```\n\nThe bilingual edition places the translation before the source text by default. Set `output.bilingual_order` to `source_first` in `config.yaml` to reverse the order.\n\n## Documentation\n\n- [Usage guide](docs/usage.md): installation, Windows setup, input and output, resuming, and utility commands.\n- [Configuration](docs/configuration.md): providers, languages, pipeline switches, segmentation, and paths.\n- [Translation pipeline](docs/pipeline.md): whole-book analysis, terminology, context, polishing, review, and resumability.\n- [Contributing](CONTRIBUTING.md): development, testing, and contribution guidelines.\n\nTranslated state directories for public-domain books may be shared through [wenyi-bookcase](https://github.com/BigDawnGhost/wenyi-bookcase). Do not publish copyrighted text, private books, or `state/` directories containing sensitive information without permission.\n\n## Project status\n\nWenyi is an early-stage personal project focused on making long-form machine translation more accurate, consistent, and readable. Reports of inconsistent names, recurring expressions, omissions, formatting problems, and provider compatibility issues are welcome through GitHub Issues and Discussions. Pull requests are also appreciated.\n\nCommunity:\n\n- [Join the Wenyi Discord server](https://discord.gg/Tybfva4HT)\n- QQ group: 1055065098\n\n## Star history\n\n<a href=\"https://www.star-history.com/?repos=BigDawnGhost%2FWenyi&type=date&legend=top-left\">\n <picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&theme=dark&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <source media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <img alt=\"Star History Chart\" src=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n </picture>\n</a>\n"}, "cb742626c592c192c9c763f404830d9bc9fe12af": {"t": 1785748699.058204, "n": 4210, "h": "48a9320885bceb84", "c": "# Wenyi\n\n**English** | [简体中文](docs/README.zh.md)\n\n\n\nWenyi is a command-line tool for translating EPUB, FB2, and TXT novels from multiple languages into Chinese. It focuses on long-form translation quality through whole-book analysis, rolling context, an evolving glossary, polishing, and review stages.\n\n## Quick start\n\nWenyi requires Python 3.10+ and [uv](https://docs.astral.sh/uv/).\n\n```bash\nuv sync\nexport DEEPSEEK_API_KEY=sk-...\nuv run trans-novel translate book.epub\n```\n\nBy default, Wenyi writes a monolingual Chinese EPUB to the source file's `output/` directory as `book.zh.epub`. A bilingual source-and-translation edition can be enabled when needed. Runtime state, chapter JSON files, the glossary database, and reports are stored under `state/`. To continue an interrupted run:\n\n```bash\nuv run trans-novel resume book.epub\nuv run trans-novel status book.epub\n```\n\n## Supported formats and output\n\n- Input: EPUB, FB2, and TXT.\n- Output: monolingual EPUB by default, optional bilingual EPUB, or plain text with `--format txt`.\n- EPUB preservation: Wenyi attempts to retain the original styles, images, table of contents, and anchors while converting translated content to horizontal layout.\n- Language detection: the source language is detected automatically by default, or it can be fixed to an ISO language code in `config.yaml`.\n\nSelect output editions from the command line:\n\n```bash\nuv run trans-novel translate book.epub --bilingual # monolingual and bilingual\nuv run trans-novel translate book.epub --no-mono --bilingual # bilingual only\n```\n\nThe bilingual edition places the translation before the source text by default. Set `output.bilingual_order` to `source_first` in `config.yaml` to reverse the order.\n\n## Documentation\n\n- [Usage guide](docs/usage.md): installation, Windows setup, input and output, resuming, and utility commands.\n- [Configuration](docs/configuration.md): providers, languages, pipeline switches, segmentation, and paths.\n- [Translation pipeline](docs/pipeline.md): whole-book analysis, terminology, context, polishing, review, and resumability.\n- [Contributing](CONTRIBUTING.md): development, testing, and contribution guidelines. The contribution guide is currently available in Chinese.\n\nTranslated state directories for public-domain books may be shared through [wenyi-bookcase](https://github.com/BigDawnGhost/wenyi-bookcase). Do not publish copyrighted text, private books, or `state/` directories containing sensitive information without permission.\n\n## Project status\n\nWenyi is an early-stage personal project focused on making long-form machine translation more accurate, consistent, and readable. Reports of inconsistent names, recurring expressions, omissions, formatting problems, and provider compatibility issues are welcome through GitHub Issues and Discussions. Pull requests are also appreciated.\n\nCommunity:\n\n- [Join the Wenyi Discord server](https://discord.gg/Tybfva4HT)\n- QQ group: 1055065098\n\n## Star history\n\n<a href=\"https://www.star-history.com/?repos=BigDawnGhost%2FWenyi&type=date&legend=top-left\">\n <picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&theme=dark&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <source media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <img alt=\"Star History Chart\" src=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n </picture>\n</a>\n"}, "81d55dba6b8232f9d630a3239921b3daced52251": {"t": 1785748700.1288798, "n": 2636, "h": "14054231730e4209", "c": "# 文译\n\n\n\n将多语言 EPUB、FB2、TXT 小说翻译为中文的命令行工具。它以长篇小说的翻译质量为重点:全书预扫、滚动上下文、实时术语库、润色和审校均可按需启用。\n\n## 快速开始\n\n需要 Python 3.10+ 与 [uv](https://docs.astral.sh/uv/)。\n\n```bash\nuv sync\nexport DEEPSEEK_API_KEY=sk-...\nuv run trans-novel translate book.epub\n```\n\n翻译完成后,默认在源文件所在目录的 `output/` 中生成单语中文版 `book.zh.epub`;也可按需生成原文对照版 `book.zh-bi.epub`。运行状态、章节 JSON、术语库和报告写入 `state/`。中断后可继续:\n\n```bash\nuv run trans-novel resume book.epub\nuv run trans-novel status book.epub\n```\n\n## 支持范围\n\n- 输入:EPUB、FB2、TXT。\n- 输出:默认生成单语 EPUB,可选双语对照版;可通过 `--format txt` 导出纯文本。\n- EPUB:尽量保留原书样式、图片、目录与锚点;译文元数据默认设为简体中文,并将竖排样式转为横排。\n- 语言:默认由模型识别源语言,也可在 `config.yaml` 固定为语言代码。\n\n可通过命令行临时选择产物:\n\n```bash\nuv run trans-novel translate book.epub --bilingual # 同时生成单语版和双语版\nuv run trans-novel translate book.epub --no-mono --bilingual # 仅生成双语版\n```\n\n双语版默认译文在上、原文在下,可在 `config.yaml` 中将 `output.bilingual_order` 改为 `source_first`。\n\n## 文档\n\n- [使用指南](docs/usage.md):安装、Windows 使用、输入输出、续跑和工具命令。\n- [配置说明](docs/configuration.md):模型、源语言、流水线开关、切分与路径配置。\n- [翻译流程](docs/pipeline.md):预扫、术语、上下文、润色、审校和断点续跑如何协作。\n- [贡献指南](CONTRIBUTING.md):开发、测试和贡献要求。\n\n公版书翻译生成的状态目录可在 [wenyi-bookcase](https://github.com/BigDawnGhost/wenyi-bookcase) 查看,也欢迎提交分享;请勿提交或分享无授权的版权文本、私人书籍或包含敏感信息的 `state/` 目录。\n\n## 憧憬与不足\n\n本项目为作者个人兴趣所开发,仅在于针对长文本书籍的译介做出一份微薄的努力,未来想让翻译在够准确的前提下更加顺畅,努力从可读向好读迈进。现阶段翻译文本一些口头禅前后翻译不一致,专有名词翻译不准确的问题,已经改进!如果还有什么问题,可以提交issue,如果你有什么想法,欢迎在讨论区提出,如果你有一定的编程能力,欢迎给我提交PR,让这个项目变得更好。👏\n\n项目交流QQ群:1055065098\n\n## 星标历史\n\n<a href=\"https://www.star-history.com/?repos=BigDawnGhost%2FWenyi&type=date&legend=top-left\">\n <picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&theme=dark&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <source media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <img alt=\"Star History Chart\" src=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n </picture>\n</a>\n"}, "a77773e5b451b600e4ceb4720829304c48378b61": {"t": 1785748701.6532083, "n": 2636, "h": "f35d5d4ca8ffb042", "c": "# 文译\n\n\n\n将多语言 EPUB、FB2、TXT 小说翻译为中文的命令行工具。它以长篇小说的翻译质量为重点:全书预扫、滚动上下文、实时术语库、润色和审校均可按需启用。\n\n## 快速开始\n\n需要 Python 3.12+ 与 [uv](https://docs.astral.sh/uv/)。\n\n```bash\nuv sync\nexport DEEPSEEK_API_KEY=sk-...\nuv run trans-novel translate book.epub\n```\n\n翻译完成后,默认在源文件所在目录的 `output/` 中生成单语中文版 `book.zh.epub`;也可按需生成原文对照版 `book.zh-bi.epub`。运行状态、章节 JSON、术语库和报告写入 `state/`。中断后可继续:\n\n```bash\nuv run trans-novel resume book.epub\nuv run trans-novel status book.epub\n```\n\n## 支持范围\n\n- 输入:EPUB、FB2、TXT。\n- 输出:默认生成单语 EPUB,可选双语对照版;可通过 `--format txt` 导出纯文本。\n- EPUB:尽量保留原书样式、图片、目录与锚点;译文元数据默认设为简体中文,并将竖排样式转为横排。\n- 语言:默认由模型识别源语言,也可在 `config.yaml` 固定为语言代码。\n\n可通过命令行临时选择产物:\n\n```bash\nuv run trans-novel translate book.epub --bilingual # 同时生成单语版和双语版\nuv run trans-novel translate book.epub --no-mono --bilingual # 仅生成双语版\n```\n\n双语版默认译文在上、原文在下,可在 `config.yaml` 中将 `output.bilingual_order` 改为 `source_first`。\n\n## 文档\n\n- [使用指南](docs/usage.md):安装、Windows 使用、输入输出、续跑和工具命令。\n- [配置说明](docs/configuration.md):模型、源语言、流水线开关、切分与路径配置。\n- [翻译流程](docs/pipeline.md):预扫、术语、上下文、润色、审校和断点续跑如何协作。\n- [贡献指南](CONTRIBUTING.md):开发、测试和贡献要求。\n\n公版书翻译生成的状态目录可在 [wenyi-bookcase](https://github.com/BigDawnGhost/wenyi-bookcase) 查看,也欢迎提交分享;请勿提交或分享无授权的版权文本、私人书籍或包含敏感信息的 `state/` 目录。\n\n## 憧憬与不足\n\n本项目为作者个人兴趣所开发,仅在于针对长文本书籍的译介做出一份微薄的努力,未来想让翻译在够准确的前提下更加顺畅,努力从可读向好读迈进。现阶段翻译文本一些口头禅前后翻译不一致,专有名词翻译不准确的问题,已经改进!如果还有什么问题,可以提交issue,如果你有什么想法,欢迎在讨论区提出,如果你有一定的编程能力,欢迎给我提交PR,让这个项目变得更好。👏\n\n项目交流QQ群:1055065098\n\n## 星标历史\n\n<a href=\"https://www.star-history.com/?repos=BigDawnGhost%2FWenyi&type=date&legend=top-left\">\n <picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&theme=dark&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <source media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <img alt=\"Star History Chart\" src=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n </picture>\n</a>\n"}, "933c914fc0b58bf4a05c2fe6d91b92d00be4092f": {"t": 1785748702.7425296, "n": 2585, "h": "97b951e45491b14c", "c": "# 文译\n\n将多语言 EPUB、FB2、TXT 小说翻译为中文的命令行工具。它以长篇小说的翻译质量为重点:全书预扫、滚动上下文、实时术语库、润色和审校均可按需启用。\n\n## 快速开始\n\n需要 Python 3.12+ 与 [uv](https://docs.astral.sh/uv/)。\n\n```bash\nuv sync\nexport DEEPSEEK_API_KEY=sk-...\nuv run trans-novel translate book.epub\n```\n\n翻译完成后,默认在源文件所在目录的 `output/` 中生成单语中文版 `book.zh.epub`;也可按需生成原文对照版 `book.zh-bi.epub`。运行状态、章节 JSON、术语库和报告写入 `state/`。中断后可继续:\n\n```bash\nuv run trans-novel resume book.epub\nuv run trans-novel status book.epub\n```\n\n## 支持范围\n\n- 输入:EPUB、FB2、TXT。\n- 输出:默认生成单语 EPUB,可选双语对照版;可通过 `--format txt` 导出纯文本。\n- EPUB:尽量保留原书样式、图片、目录与锚点;译文元数据默认设为简体中文,并将竖排样式转为横排。\n- 语言:默认由模型识别源语言,也可在 `config.yaml` 固定为语言代码。\n\n可通过命令行临时选择产物:\n\n```bash\nuv run trans-novel translate book.epub --bilingual # 同时生成单语版和双语版\nuv run trans-novel translate book.epub --no-mono --bilingual # 仅生成双语版\n```\n\n双语版默认译文在上、原文在下,可在 `config.yaml` 中将 `output.bilingual_order` 改为 `source_first`。\n\n## 文档\n\n- [使用指南](docs/usage.md):安装、Windows 使用、输入输出、续跑和工具命令。\n- [配置说明](docs/configuration.md):模型、源语言、流水线开关、切分与路径配置。\n- [翻译流程](docs/pipeline.md):预扫、术语、上下文、润色、审校和断点续跑如何协作。\n- [贡献指南](CONTRIBUTING.md):开发、测试和贡献要求。\n\n公版书翻译生成的状态目录可在 [wenyi-bookcase](https://github.com/BigDawnGhost/wenyi-bookcase) 查看,也欢迎提交分享;请勿提交或分享无授权的版权文本、私人书籍或包含敏感信息的 `state/` 目录。\n\n## 憧憬与不足\n\n本项目为作者个人兴趣所开发,仅在于针对长文本书籍的译介做出一份微薄的努力,未来想让翻译在够准确的前提下更加顺畅,努力从可读向好读迈进。现阶段翻译文本一些口头禅前后翻译不一致,专有名词翻译不准确的问题,已经改进!如果还有什么问题,可以提交issue,如果你有什么想法,欢迎在讨论区提出,如果你有一定的编程能力,欢迎给我提交PR,让这个项目变得更好。👏\n\n项目交流QQ群:1055065098\n\n## 星标历史\n\n<a href=\"https://www.star-history.com/?repos=BigDawnGhost%2FWenyi&type=date&legend=top-left\">\n <picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&theme=dark&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <source media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <img alt=\"Star History Chart\" src=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n </picture>\n</a>\n"}, "99f007bf88379b30c3dd6ff2b5bba176d8888b4f": {"t": 1785748703.8407836, "n": 2277, "h": "70610f0893c41481", "c": "# 文译\n\n将多语言 EPUB、FB2、TXT 小说翻译为中文的命令行工具。它以长篇小说的翻译质量为重点:全书预扫、滚动上下文、实时术语库、润色和审校均可按需启用。\n\n## 快速开始\n\n需要 Python 3.12+ 与 [uv](https://docs.astral.sh/uv/)。\n\n```bash\nuv sync\nexport DEEPSEEK_API_KEY=sk-...\nuv run trans-novel translate book.epub\n```\n\n翻译完成后,默认在源文件所在目录的 `output/` 中生成中文 EPUB;运行状态、章节 JSON、术语库和报告写入 `state/`。中断后可继续:\n\n```bash\nuv run trans-novel resume book.epub\nuv run trans-novel status book.epub\n```\n\n## 支持范围\n\n- 输入:EPUB、FB2、TXT。\n- 输出:默认 EPUB;可通过 `--format txt` 导出纯文本。\n- EPUB:尽量保留原书样式、图片、目录与锚点;译文元数据默认设为简体中文,并将竖排样式转为横排。\n- 语言:默认由模型识别源语言,也可在 `config.yaml` 固定为语言代码。\n\n## 文档\n\n- [使用指南](docs/usage.md):安装、Windows 使用、输入输出、续跑和工具命令。\n- [配置说明](docs/configuration.md):模型、源语言、流水线开关、切分与路径配置。\n- [翻译流程](docs/pipeline.md):预扫、术语、上下文、润色、审校和断点续跑如何协作。\n- [贡献指南](CONTRIBUTING.md):开发、测试和贡献要求。\n\n公版书翻译生成的状态目录可在 [wenyi-bookcase](https://github.com/BigDawnGhost/wenyi-bookcase) 查看,也欢迎提交分享;请勿提交或分享无授权的版权文本、私人书籍或包含敏感信息的 `state/` 目录。\n\n## 憧憬与不足\n\n本项目为作者个人兴趣所开发,仅在于针对长文本书籍的译介做出一份微薄的努力,未来想让翻译在够准确的前提下更加顺畅,努力从可读向好读迈进。现阶段翻译文本一些口头禅前后翻译不一致,专有名词翻译不准确的问题,已经改进!如果还有什么问题,可以提交issue,如果你有什么想法,欢迎在讨论区提出,如果你有一定的编程能力,欢迎给我提交PR,让这个项目变得更好。👏\n\n项目交流QQ群:1055065098\n\n## 星标历史\n\n<a href=\"https://www.star-history.com/?repos=BigDawnGhost%2FWenyi&type=date&legend=top-left\">\n <picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&theme=dark&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <source media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <img alt=\"Star History Chart\" src=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n </picture>\n</a>\n"}, "152fa6ecf8eb66f02845c11763580983d7ea9387": {"t": 1785748704.926119, "n": 2077, "h": "0bfa1626a5184565", "c": "# 文译\n\n将多语言 EPUB、FB2、TXT 小说翻译为简体中文的命令行工具。它以长篇小说的一致性为重点:全书预扫、滚动上下文、实时术语库、润色和审校均可按需启用。\n\n## 快速开始\n\n需要 Python 3.12+ 与 [uv](https://docs.astral.sh/uv/)。\n\n```bash\nuv sync\nexport DEEPSEEK_API_KEY=sk-...\nuv run trans-novel translate book.epub\n```\n\n翻译完成后,默认在源文件目录生成中文 EPUB;运行状态、章节 JSON、术语库和报告写入 `state/`。中断后可继续:\n\n```bash\nuv run trans-novel resume book.epub\nuv run trans-novel status book.epub\n```\n\n## 支持范围\n\n- 输入:EPUB、FB2、TXT。\n- 输出:默认 EPUB;可通过 `--format txt` 导出纯文本。\n- EPUB:尽量保留原书样式、图片、目录与锚点;译文元数据默认设为简体中文,并将竖排样式转为横排。\n- 语言:默认由模型识别源语言,也可在 `config.yaml` 固定为语言代码。\n\n## 文档\n\n- [使用指南](docs/usage.md):安装、Windows 使用、输入输出、续跑和工具命令。\n- [配置说明](docs/configuration.md):模型、源语言、流水线开关、切分与路径配置。\n- [翻译流程](docs/pipeline.md):预扫、术语、上下文、润色、审校和断点续跑如何协作。\n- [贡献指南](CONTRIBUTING.md):开发、测试和贡献要求。\n\n公版书翻译生成的状态目录可在 [wenyi-bookcase](https://github.com/BigDawnGhost/wenyi-bookcase) 查看,也欢迎提交分享;请勿提交或分享无授权的版权文本、私人书籍或包含敏感信息的 `state/` 目录。\n\n项目交流QQ群:1055065098\n\n## 星标历史\n\n<a href=\"https://www.star-history.com/?repos=BigDawnGhost%2FWenyi&type=date&legend=top-left\">\n <picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&theme=dark&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <source media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <img alt=\"Star History Chart\" src=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n </picture>\n</a>\n"}, "7842ac45e35b6ad2381d6eeb7d260aaff73da5e9": {"t": 1785748706.0264423, "n": 5140, "h": "0bdc3b160c0541e0", "c": "# 文译\n\n专注于将多语言 EPUB、FB2 或 TXT 小说翻译成中文,并尽量保留 EPUB 原排版、图片、目录和跳转。\n\n项目的日常入口只有一个命令:`translate`。它会完成预扫、分析、翻译、可选润色、章末审校、标点规范化和 EPUB 导出;中断后可以继续跑。\n\n## 快速开始\n\n```bash\nuv sync\nexport DEEPSEEK_API_KEY=sk-...\nuv run trans-novel translate book.epub\n```\n\nWindows PowerShell(打包版 `wenyi.exe`)先设置 API Key:\n\n```powershell\n# 仅当前 PowerShell 窗口生效\n$env:DEEPSEEK_API_KEY = \"sk-...\"\n.\\wenyi.exe translate .\\book.epub\n```\n\n翻译完成后,默认会在源文件目录下生成译文 EPUB。运行状态、章节 JSON、术语库和报告会放在 `state/` 目录下。\n\n中断后继续:\n\n```bash\nuv run trans-novel resume book.epub\n```\n\n查看进度:\n\n```bash\nuv run trans-novel status book.epub\n```\n\n仅重新导出 EPUB:\n\n```bash\nuv run trans-novel tools assemble book.epub\n```\n\n## 输入和输出\n\n- 输入:EPUB、FB2、TXT。\n- 默认输出:中文 EPUB。\n- EPUB 输入会按原 XHTML 模板回填译文,尽量保留原书样式、图片、目录和锚点。\n- TXT 输入会生成新的 EPUB。\n- 需要纯文本时使用 `--format txt`。\n\n示例:\n\n```bash\nuv run trans-novel translate book.epub\nuv run trans-novel translate book.epub --format txt\nuv run trans-novel translate book.epub --chapter 3\n```\n\n## 常用开关\n\n```bash\nuv run trans-novel translate book.epub --polish\nuv run trans-novel translate book.epub --no-polish\nuv run trans-novel translate book.epub --qa\nuv run trans-novel translate book.epub --no-qa\n```\n\n`--polish/--no-polish` 会覆盖 `config.yaml` 里的 `pipeline.polish`。当前仓库的 `config.yaml` 写的是 `polish: true`,所以不加参数时默认会润色;代码层面的缺省值是 `false`,只在配置文件没写该字段时生效。\n\n润色会让每个翻译批次多一次 `strong` 档 LLM 请求,质量可能更稳,但会明显增加耗时和成本。已经翻译完成的批次会被断点续跑跳过,后来再开关润色不会自动重跑旧译文。\n\n## 配置\n\n主要配置都在 `config.yaml`:\n\n- `language.source`: `auto` 由模型识别源语言,也可以写死语言代码,如 `ja`、`en`、`ko`、`ru`、`de` 等。\n- `llm.tiers`: 配置 `strong`、`cheap`、`fast` 三档模型。\n- `pipeline.review`: 章末审校。\n- `pipeline.autofix_severe`: 对严重问题自动重译并采纳通过校验的结果。\n- `pipeline.polish`: 翻译后再做中文润色。\n- `pipeline.backtranslate_sample`: 回译抽检比例,`0` 为关闭。\n- `pipeline.consistency_qa`: 全书跨章一致性扫描。\n- `pipeline.book_understanding`: 翻译前预扫整本书,生成全书概览和逐章梗概。\n- `pipeline.rolling_context_segments`: 每批翻译时带入的前文译文段数。\n- `segment.max_chars_per_batch`: 每个翻译批次的大小。\n- `segment.max_chars_per_segment`: 超长段落的拆分阈值。\n\n离线测试或调试流程时,可以把 `llm.provider` 改成 `fake`,不会发网络请求。\n\n## 工作流程\n\n默认连续流程大致是:\n\n```text\n读取输入\n→ 解析章节、正文段落和 EPUB 目录\n→ 模型识别源语言(或使用配置指定语言)\n→ 预扫整本书,生成全书概览和逐章梗概\n→ 分析样章,建立初始术语表\n→ 按章、按批翻译\n→ 可选润色\n→ 标点规范化\n→ 章末 review\n→ 可选严重项自动重译\n→ 可选一致性 QA\n→ 回填导出 EPUB/TXT\n```\n\n每个批次翻译完成后都会写入 `state/`,所以长书中断后可以续跑。已经有译文的批次会跳过,只补未完成部分。\n\n## 一致性机制\n\n- **术语库**:人名、地名、专有名词和敬称会进入 SQLite 术语库,翻译时按配置注入提示词。\n- **全书理解**:翻译前预扫源文,生成全书概览和章节梗概,让早期章节也能参考全书走向。\n- **滚动上下文**:章内批次串行处理,后一个批次能看到前面最近几段译文。\n- **段数对齐**:每批输入 N 段,要求模型输出 N 段 JSON;段数不符会重试,仍失败则逐段兜底。\n- **章末 review**:按章检查漏译、误译、术语、人称等问题;默认只记录问题,是否自动修复由 `autofix_severe` 控制。\n- **标点规范化**:译文统一为简体中文大陆常用全角标点。\n\n## 常用工具\n\n```bash\nuv run trans-novel tools glossary book.epub list\nuv run trans-novel tools glossary book.epub conflicts\nuv run trans-novel tools qa book.epub\nuv run trans-novel tools report book.epub\nuv run trans-novel tools assemble book.epub\n```\n\n这些工具主要用于查看术语库、检查一致性、生成报告或重新导出成品。QA 和报告默认只汇总问题,不会自动改正文。\n\n## 模型档位\n\n默认配置使用 DeepSeek,并通过 OpenAI SDK 调用 `https://api.deepseek.com`。\n\n- `strong`: 翻译、润色、全局分析、标题翻译。\n- `cheap`: 章末 review、一致性 QA、回译比对。\n- `fast`: 全书预扫、章节梗概、术语抽取、回译等机械任务。\n\n如果模型 ID 变化,直接改 `config.yaml` 里的 `llm.tiers`。\n\n## 项目结构\n\n```text\ntrans_novel/\n ingest/ 输入解析、EPUB/FB2/TXT 切分\n llm/ LLM 抽象接口、DeepSeek provider、FakeClient\n glossary/ SQLite 术语库、抽取、冲突处理\n agents/ 分析、翻译、审校、润色、一致性、提示词\n pipeline/ 编排器、断点状态、滚动上下文、校验\n postprocess/ 标点规范化\n assemble/ EPUB/TXT 回填导出、QA 报告\ntests/ 离线测试\n```\n\n## 测试\n\n```bash\nUV_CACHE_DIR=/tmp/uv-cache uv run python -m unittest discover -s tests\n```\n\n如果本机 `uv` 缓存目录可写,也可以直接运行:\n\n```bash\nuv run python -m unittest discover -s tests\n```\n\n## 贡献\n\n欢迎提交 bug 修复、格式兼容、测试样例和文档改进。开发说明见 [CONTRIBUTING.md](CONTRIBUTING.md)。\n\n公版书翻译生成的状态目录可在 [wenyi-bookcase](https://github.com/BigDawnGhost/wenyi-bookcase) 查看,也欢迎提交分享;请勿提交或分享无授权的版权文本、私人书籍或包含敏感信息的 `state/` 目录。\n\n项目交流QQ群:1055065098\n\n## 憧憬与不足\n\n本项目为作者个人兴趣所开发,仅在于针对长文本书籍的译介做出一份微薄的努力,未来想让翻译在够准确的前提下更加顺畅,努力从可读向好读迈进。现阶段翻译文本一些口头禅前后翻译不一致,专有名词翻译不准确的问题,已经改进!如果还有什么问题,可以提交issue,如果你有什么想法,欢迎在讨论区提出,如果你有一定的编程能力,欢迎给我提交PR,让这个项目变得更好。👏\n\n## 星标历史\n\n<a href=\"https://www.star-history.com/?repos=BigDawnGhost%2FWenyi&type=date&legend=top-left\">\n <picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&theme=dark&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <source media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <img alt=\"Star History Chart\" src=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n </picture>\n</a>\n"}, "b82addce97a672223c0a659b394f97a5bc45650b": {"t": 1785748707.1719942, "n": 4983, "h": "8330d73cf334a730", "c": "# 文译\n\n专注于将多语言 EPUB、FB2 或 TXT 小说翻译成中文,并尽量保留 EPUB 原排版、图片、目录和跳转。\n\n项目的日常入口只有一个命令:`translate`。它会完成预扫、分析、翻译、可选润色、章末审校、标点规范化和 EPUB 导出;中断后可以继续跑。\n\n## 快速开始\n\n```bash\nuv sync\nexport DEEPSEEK_API_KEY=sk-...\nuv run trans-novel translate book.epub\n```\n\n翻译完成后,默认会在源文件目录下生成译文 EPUB。运行状态、章节 JSON、术语库和报告会放在 `state/` 目录下。\n\n中断后继续:\n\n```bash\nuv run trans-novel resume book.epub\n```\n\n查看进度:\n\n```bash\nuv run trans-novel status book.epub\n```\n\n仅重新导出 EPUB:\n\n```bash\nuv run trans-novel tools assemble book.epub\n```\n\n## 输入和输出\n\n- 输入:EPUB、FB2、TXT。\n- 默认输出:中文 EPUB。\n- EPUB 输入会按原 XHTML 模板回填译文,尽量保留原书样式、图片、目录和锚点。\n- TXT 输入会生成新的 EPUB。\n- 需要纯文本时使用 `--format txt`。\n\n示例:\n\n```bash\nuv run trans-novel translate book.epub\nuv run trans-novel translate book.epub --format txt\nuv run trans-novel translate book.epub --chapter 3\n```\n\n## 常用开关\n\n```bash\nuv run trans-novel translate book.epub --polish\nuv run trans-novel translate book.epub --no-polish\nuv run trans-novel translate book.epub --qa\nuv run trans-novel translate book.epub --no-qa\n```\n\n`--polish/--no-polish` 会覆盖 `config.yaml` 里的 `pipeline.polish`。当前仓库的 `config.yaml` 写的是 `polish: true`,所以不加参数时默认会润色;代码层面的缺省值是 `false`,只在配置文件没写该字段时生效。\n\n润色会让每个翻译批次多一次 `strong` 档 LLM 请求,质量可能更稳,但会明显增加耗时和成本。已经翻译完成的批次会被断点续跑跳过,后来再开关润色不会自动重跑旧译文。\n\n## 配置\n\n主要配置都在 `config.yaml`:\n\n- `language.source`: `auto` 由模型识别源语言,也可以写死语言代码,如 `ja`、`en`、`ko`、`ru`、`de` 等。\n- `llm.tiers`: 配置 `strong`、`cheap`、`fast` 三档模型。\n- `pipeline.review`: 章末审校。\n- `pipeline.autofix_severe`: 对严重问题自动重译并采纳通过校验的结果。\n- `pipeline.polish`: 翻译后再做中文润色。\n- `pipeline.backtranslate_sample`: 回译抽检比例,`0` 为关闭。\n- `pipeline.consistency_qa`: 全书跨章一致性扫描。\n- `pipeline.book_understanding`: 翻译前预扫整本书,生成全书概览和逐章梗概。\n- `pipeline.rolling_context_segments`: 每批翻译时带入的前文译文段数。\n- `segment.max_chars_per_batch`: 每个翻译批次的大小。\n- `segment.max_chars_per_segment`: 超长段落的拆分阈值。\n\n离线测试或调试流程时,可以把 `llm.provider` 改成 `fake`,不会发网络请求。\n\n## 工作流程\n\n默认连续流程大致是:\n\n```text\n读取输入\n→ 解析章节、正文段落和 EPUB 目录\n→ 模型识别源语言(或使用配置指定语言)\n→ 预扫整本书,生成全书概览和逐章梗概\n→ 分析样章,建立初始术语表\n→ 按章、按批翻译\n→ 可选润色\n→ 标点规范化\n→ 章末 review\n→ 可选严重项自动重译\n→ 可选一致性 QA\n→ 回填导出 EPUB/TXT\n```\n\n每个批次翻译完成后都会写入 `state/`,所以长书中断后可以续跑。已经有译文的批次会跳过,只补未完成部分。\n\n## 一致性机制\n\n- **术语库**:人名、地名、专有名词和敬称会进入 SQLite 术语库,翻译时按配置注入提示词。\n- **全书理解**:翻译前预扫源文,生成全书概览和章节梗概,让早期章节也能参考全书走向。\n- **滚动上下文**:章内批次串行处理,后一个批次能看到前面最近几段译文。\n- **段数对齐**:每批输入 N 段,要求模型输出 N 段 JSON;段数不符会重试,仍失败则逐段兜底。\n- **章末 review**:按章检查漏译、误译、术语、人称等问题;默认只记录问题,是否自动修复由 `autofix_severe` 控制。\n- **标点规范化**:译文统一为简体中文大陆常用全角标点。\n\n## 常用工具\n\n```bash\nuv run trans-novel tools glossary book.epub list\nuv run trans-novel tools glossary book.epub conflicts\nuv run trans-novel tools qa book.epub\nuv run trans-novel tools report book.epub\nuv run trans-novel tools assemble book.epub\n```\n\n这些工具主要用于查看术语库、检查一致性、生成报告或重新导出成品。QA 和报告默认只汇总问题,不会自动改正文。\n\n## 模型档位\n\n默认配置使用 DeepSeek,并通过 OpenAI SDK 调用 `https://api.deepseek.com`。\n\n- `strong`: 翻译、润色、全局分析、标题翻译。\n- `cheap`: 章末 review、一致性 QA、回译比对。\n- `fast`: 全书预扫、章节梗概、术语抽取、回译等机械任务。\n\n如果模型 ID 变化,直接改 `config.yaml` 里的 `llm.tiers`。\n\n## 项目结构\n\n```text\ntrans_novel/\n ingest/ 输入解析、EPUB/FB2/TXT 切分\n llm/ LLM 抽象接口、DeepSeek provider、FakeClient\n glossary/ SQLite 术语库、抽取、冲突处理\n agents/ 分析、翻译、审校、润色、一致性、提示词\n pipeline/ 编排器、断点状态、滚动上下文、校验\n postprocess/ 标点规范化\n assemble/ EPUB/TXT 回填导出、QA 报告\ntests/ 离线测试\n```\n\n## 测试\n\n```bash\nUV_CACHE_DIR=/tmp/uv-cache uv run python -m unittest discover -s tests\n```\n\n如果本机 `uv` 缓存目录可写,也可以直接运行:\n\n```bash\nuv run python -m unittest discover -s tests\n```\n\n## 贡献\n\n欢迎提交 bug 修复、格式兼容、测试样例和文档改进。开发说明见 [CONTRIBUTING.md](CONTRIBUTING.md)。\n\n公版书翻译生成的状态目录可在 [wenyi-bookcase](https://github.com/BigDawnGhost/wenyi-bookcase) 查看,也欢迎提交分享;请勿提交或分享无授权的版权文本、私人书籍或包含敏感信息的 `state/` 目录。\n\n项目交流QQ群:1055065098\n\n## 憧憬与不足\n\n本项目为作者个人兴趣所开发,仅在于针对长文本书籍的译介做出一份微薄的努力,未来想让翻译在够准确的前提下更加顺畅,努力从可读向好读迈进。现阶段翻译文本一些口头禅前后翻译不一致,专有名词翻译不准确的问题,已经改进!如果还有什么问题,可以提交issue,如果你有什么想法,欢迎在讨论区提出,如果你有一定的编程能力,欢迎给我提交PR,让这个项目变得更好。👏\n\n## 星标历史\n\n<a href=\"https://www.star-history.com/?repos=BigDawnGhost%2FWenyi&type=date&legend=top-left\">\n <picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&theme=dark&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <source media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <img alt=\"Star History Chart\" src=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n </picture>\n</a>\n"}, "af906c365b7a75cfe127293bb6b0de3af8d27e45": {"t": 1785748708.2857473, "n": 4963, "h": "a4bcdaab83137098", "c": "# 文译\n\n专注于将多语言 EPUB、FB2 或 TXT 小说翻译成中文,并尽量保留 EPUB 原排版、图片、目录和跳转。\n\n项目的日常入口只有一个命令:`translate`。它会完成预扫、分析、翻译、可选润色、章末审校、标点规范化和 EPUB 导出;中断后可以继续跑。\n\n## 快速开始\n\n```bash\nuv sync\nexport DEEPSEEK_API_KEY=sk-...\nuv run trans-novel translate book.epub\n```\n\n翻译完成后,默认会在源文件目录下生成译文 EPUB。运行状态、章节 JSON、术语库和报告会放在 `state/` 目录下。\n\n中断后继续:\n\n```bash\nuv run trans-novel resume book.epub\n```\n\n查看进度:\n\n```bash\nuv run trans-novel status book.epub\n```\n\n仅重新导出 EPUB:\n\n```bash\nuv run trans-novel tools assemble book.epub\n```\n\n## 输入和输出\n\n- 输入:EPUB、FB2、TXT。\n- 默认输出:中文 EPUB。\n- EPUB 输入会按原 XHTML 模板回填译文,尽量保留原书样式、图片、目录和锚点。\n- TXT 输入会生成新的 EPUB。\n- 需要纯文本时使用 `--format txt`。\n\n示例:\n\n```bash\nuv run trans-novel translate book.epub\nuv run trans-novel translate book.epub --format txt\nuv run trans-novel translate book.epub --chapter 3\n```\n\n## 常用开关\n\n```bash\nuv run trans-novel translate book.epub --polish\nuv run trans-novel translate book.epub --no-polish\nuv run trans-novel translate book.epub --qa\nuv run trans-novel translate book.epub --no-qa\n```\n\n`--polish/--no-polish` 会覆盖 `config.yaml` 里的 `pipeline.polish`。当前仓库的 `config.yaml` 写的是 `polish: true`,所以不加参数时默认会润色;代码层面的缺省值是 `false`,只在配置文件没写该字段时生效。\n\n润色会让每个翻译批次多一次 `strong` 档 LLM 请求,质量可能更稳,但会明显增加耗时和成本。已经翻译完成的批次会被断点续跑跳过,后来再开关润色不会自动重跑旧译文。\n\n## 配置\n\n主要配置都在 `config.yaml`:\n\n- `language.source`: `auto` 由模型识别源语言,也可以写死语言代码,如 `ja`、`en`、`ko`、`ru`、`de` 等。\n- `llm.tiers`: 配置 `strong`、`cheap`、`fast` 三档模型。\n- `pipeline.review`: 章末审校。\n- `pipeline.autofix_severe`: 对严重问题自动重译并采纳通过校验的结果。\n- `pipeline.polish`: 翻译后再做中文润色。\n- `pipeline.backtranslate_sample`: 回译抽检比例,`0` 为关闭。\n- `pipeline.consistency_qa`: 全书跨章一致性扫描。\n- `pipeline.book_understanding`: 翻译前预扫整本书,生成全书概览和逐章梗概。\n- `pipeline.rolling_context_segments`: 每批翻译时带入的前文译文段数。\n- `segment.max_chars_per_batch`: 每个翻译批次的大小。\n- `segment.max_chars_per_segment`: 超长段落的拆分阈值。\n\n离线测试或调试流程时,可以把 `llm.provider` 改成 `fake`,不会发网络请求。\n\n## 工作流程\n\n默认连续流程大致是:\n\n```text\n读取输入\n→ 解析章节、正文段落和 EPUB 目录\n→ 模型识别源语言(或使用配置指定语言)\n→ 预扫整本书,生成全书概览和逐章梗概\n→ 分析样章,建立初始术语表\n→ 按章、按批翻译\n→ 可选润色\n→ 标点规范化\n→ 章末 review\n→ 可选严重项自动重译\n→ 可选一致性 QA\n→ 回填导出 EPUB/TXT\n```\n\n每个批次翻译完成后都会写入 `state/`,所以长书中断后可以续跑。已经有译文的批次会跳过,只补未完成部分。\n\n## 一致性机制\n\n- **术语库**:人名、地名、专有名词和敬称会进入 SQLite 术语库,翻译时按配置注入提示词。\n- **全书理解**:翻译前预扫源文,生成全书概览和章节梗概,让早期章节也能参考全书走向。\n- **滚动上下文**:章内批次串行处理,后一个批次能看到前面最近几段译文。\n- **段数对齐**:每批输入 N 段,要求模型输出 N 段 JSON;段数不符会重试,仍失败则逐段兜底。\n- **章末 review**:按章检查漏译、误译、术语、人称等问题;默认只记录问题,是否自动修复由 `autofix_severe` 控制。\n- **标点规范化**:译文统一为简体中文大陆常用全角标点。\n\n## 常用工具\n\n```bash\nuv run trans-novel tools glossary book.epub list\nuv run trans-novel tools glossary book.epub conflicts\nuv run trans-novel tools qa book.epub\nuv run trans-novel tools report book.epub\nuv run trans-novel tools assemble book.epub\n```\n\n这些工具主要用于查看术语库、检查一致性、生成报告或重新导出成品。QA 和报告默认只汇总问题,不会自动改正文。\n\n## 模型档位\n\n默认配置使用 DeepSeek,并通过 OpenAI SDK 调用 `https://api.deepseek.com`。\n\n- `strong`: 翻译、润色、全局分析、标题翻译。\n- `cheap`: 章末 review、一致性 QA、回译比对。\n- `fast`: 全书预扫、章节梗概、术语抽取、回译等机械任务。\n\n如果模型 ID 变化,直接改 `config.yaml` 里的 `llm.tiers`。\n\n## 项目结构\n\n```text\ntrans_novel/\n ingest/ 输入解析、EPUB/FB2/TXT 切分\n llm/ LLM 抽象接口、DeepSeek provider、FakeClient\n glossary/ SQLite 术语库、抽取、冲突处理\n agents/ 分析、翻译、审校、润色、一致性、提示词\n pipeline/ 编排器、断点状态、滚动上下文、校验\n postprocess/ 标点规范化\n assemble/ EPUB/TXT 回填导出、QA 报告\ntests/ 离线测试\n```\n\n## 测试\n\n```bash\nUV_CACHE_DIR=/tmp/uv-cache uv run python -m unittest discover -s tests\n```\n\n如果本机 `uv` 缓存目录可写,也可以直接运行:\n\n```bash\nuv run python -m unittest discover -s tests\n```\n\n## 贡献\n\n欢迎提交 bug 修复、格式兼容、测试样例和文档改进。开发说明见 [CONTRIBUTING.md](CONTRIBUTING.md)。\n\n公版书翻译生成的状态目录可在 [wenyi-bookcase](https://github.com/BigDawnGhost/wenyi-bookcase) 查看,也欢迎提交分享;请勿提交或分享无授权的版权文本、私人书籍或包含敏感信息的 `state/` 目录。\n\n## 憧憬与不足\n\n本项目为作者个人兴趣所开发,仅在于针对长文本书籍的译介做出一份微薄的努力,未来想让翻译在够准确的前提下更加顺畅,努力从可读向好读迈进。现阶段翻译文本一些口头禅前后翻译不一致,专有名词翻译不准确的问题,已经改进!如果还有什么问题,可以提交issue,如果你有什么想法,欢迎在讨论区提出,如果你有一定的编程能力,欢迎给我提交PR,让这个项目变得更好。👏\n\n## 星标历史\n\n<a href=\"https://www.star-history.com/?repos=BigDawnGhost%2FWenyi&type=date&legend=top-left\">\n <picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&theme=dark&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <source media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <img alt=\"Star History Chart\" src=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n </picture>\n</a>\n"}, "26936290ee71768e0aeae523b5bb48a2b3b64b58": {"t": 1785748709.4135895, "n": 4829, "h": "544c7bf54ae43328", "c": "# 文译\n\n专注于将多语言 EPUB、FB2 或 TXT 小说翻译成中文,并尽量保留 EPUB 原排版、图片、目录和跳转。\n\n项目的日常入口只有一个命令:`translate`。它会完成预扫、分析、翻译、可选润色、章末审校、标点规范化和 EPUB 导出;中断后可以继续跑。\n\n## 快速开始\n\n```bash\nuv sync\nexport DEEPSEEK_API_KEY=sk-...\nuv run trans-novel translate book.epub\n```\n\n翻译完成后,默认会在源文件目录下生成译文 EPUB。运行状态、章节 JSON、术语库和报告会放在 `state/` 目录下。\n\n中断后继续:\n\n```bash\nuv run trans-novel resume book.epub\n```\n\n查看进度:\n\n```bash\nuv run trans-novel status book.epub\n```\n\n仅重新导出 EPUB:\n\n```bash\nuv run trans-novel tools assemble book.epub\n```\n\n## 输入和输出\n\n- 输入:EPUB、FB2、TXT。\n- 默认输出:中文 EPUB。\n- EPUB 输入会按原 XHTML 模板回填译文,尽量保留原书样式、图片、目录和锚点。\n- TXT 输入会生成新的 EPUB。\n- 需要纯文本时使用 `--format txt`。\n\n示例:\n\n```bash\nuv run trans-novel translate book.epub\nuv run trans-novel translate book.epub --format txt\nuv run trans-novel translate book.epub --chapter 3\n```\n\n## 常用开关\n\n```bash\nuv run trans-novel translate book.epub --polish\nuv run trans-novel translate book.epub --no-polish\nuv run trans-novel translate book.epub --qa\nuv run trans-novel translate book.epub --no-qa\n```\n\n`--polish/--no-polish` 会覆盖 `config.yaml` 里的 `pipeline.polish`。当前仓库的 `config.yaml` 写的是 `polish: true`,所以不加参数时默认会润色;代码层面的缺省值是 `false`,只在配置文件没写该字段时生效。\n\n润色会让每个翻译批次多一次 `strong` 档 LLM 请求,质量可能更稳,但会明显增加耗时和成本。已经翻译完成的批次会被断点续跑跳过,后来再开关润色不会自动重跑旧译文。\n\n## 配置\n\n主要配置都在 `config.yaml`:\n\n- `language.source`: `auto` 由模型识别源语言,也可以写死语言代码,如 `ja`、`en`、`ko`、`ru`、`de` 等。\n- `llm.tiers`: 配置 `strong`、`cheap`、`fast` 三档模型。\n- `pipeline.review`: 章末审校。\n- `pipeline.autofix_severe`: 对严重问题自动重译并采纳通过校验的结果。\n- `pipeline.polish`: 翻译后再做中文润色。\n- `pipeline.backtranslate_sample`: 回译抽检比例,`0` 为关闭。\n- `pipeline.consistency_qa`: 全书跨章一致性扫描。\n- `pipeline.book_understanding`: 翻译前预扫整本书,生成全书概览和逐章梗概。\n- `pipeline.rolling_context_segments`: 每批翻译时带入的前文译文段数。\n- `segment.max_chars_per_batch`: 每个翻译批次的大小。\n- `segment.max_chars_per_segment`: 超长段落的拆分阈值。\n\n离线测试或调试流程时,可以把 `llm.provider` 改成 `fake`,不会发网络请求。\n\n## 工作流程\n\n默认连续流程大致是:\n\n```text\n读取输入\n→ 解析章节、正文段落和 EPUB 目录\n→ 模型识别源语言(或使用配置指定语言)\n→ 预扫整本书,生成全书概览和逐章梗概\n→ 分析样章,建立初始术语表\n→ 按章、按批翻译\n→ 可选润色\n→ 标点规范化\n→ 章末 review\n→ 可选严重项自动重译\n→ 可选一致性 QA\n→ 回填导出 EPUB/TXT\n```\n\n每个批次翻译完成后都会写入 `state/`,所以长书中断后可以续跑。已经有译文的批次会跳过,只补未完成部分。\n\n## 一致性机制\n\n- **术语库**:人名、地名、专有名词和敬称会进入 SQLite 术语库,翻译时按配置注入提示词。\n- **全书理解**:翻译前预扫源文,生成全书概览和章节梗概,让早期章节也能参考全书走向。\n- **滚动上下文**:章内批次串行处理,后一个批次能看到前面最近几段译文。\n- **段数对齐**:每批输入 N 段,要求模型输出 N 段 JSON;段数不符会重试,仍失败则逐段兜底。\n- **章末 review**:按章检查漏译、误译、术语、人称等问题;默认只记录问题,是否自动修复由 `autofix_severe` 控制。\n- **标点规范化**:译文统一为简体中文大陆常用全角标点。\n\n## 常用工具\n\n```bash\nuv run trans-novel tools glossary book.epub list\nuv run trans-novel tools glossary book.epub conflicts\nuv run trans-novel tools qa book.epub\nuv run trans-novel tools report book.epub\nuv run trans-novel tools assemble book.epub\n```\n\n这些工具主要用于查看术语库、检查一致性、生成报告或重新导出成品。QA 和报告默认只汇总问题,不会自动改正文。\n\n## 模型档位\n\n默认配置使用 DeepSeek,并通过 OpenAI SDK 调用 `https://api.deepseek.com`。\n\n- `strong`: 翻译、润色、全局分析、标题翻译。\n- `cheap`: 章末 review、一致性 QA、回译比对。\n- `fast`: 全书预扫、章节梗概、术语抽取、回译等机械任务。\n\n如果模型 ID 变化,直接改 `config.yaml` 里的 `llm.tiers`。\n\n## 项目结构\n\n```text\ntrans_novel/\n ingest/ 输入解析、EPUB/FB2/TXT 切分\n llm/ LLM 抽象接口、DeepSeek provider、FakeClient\n glossary/ SQLite 术语库、抽取、冲突处理\n agents/ 分析、翻译、审校、润色、一致性、提示词\n pipeline/ 编排器、断点状态、滚动上下文、校验\n postprocess/ 标点规范化\n assemble/ EPUB/TXT 回填导出、QA 报告\ntests/ 离线测试\n```\n\n## 测试\n\n```bash\nUV_CACHE_DIR=/tmp/uv-cache uv run python -m unittest discover -s tests\n```\n\n如果本机 `uv` 缓存目录可写,也可以直接运行:\n\n```bash\nuv run python -m unittest discover -s tests\n```\n\n## 贡献\n\n欢迎提交 bug 修复、格式兼容、测试样例和文档改进。开发说明见 [CONTRIBUTING.md](CONTRIBUTING.md)。\n\n## 憧憬与不足\n\n本项目为作者个人兴趣所开发,仅在于针对长文本书籍的译介做出一份微薄的努力,未来想让翻译在够准确的前提下更加顺畅,努力从可读向好读迈进。现阶段翻译文本一些口头禅前后翻译不一致,专有名词翻译不准确的问题,已经改进!如果还有什么问题,可以提交issue,如果你有什么想法,欢迎在讨论区提出,如果你有一定的编程能力,欢迎给我提交PR,让这个项目变得更好。👏\n\n## 星标历史\n\n<a href=\"https://www.star-history.com/?repos=BigDawnGhost%2FWenyi&type=date&legend=top-left\">\n <picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&theme=dark&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <source media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <img alt=\"Star History Chart\" src=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n </picture>\n</a>\n"}, "6a8cfc1af193b8861be892ff194983a905097306": {"t": 1785748710.5126638, "n": 4752, "h": "340f07011da5b66d", "c": "# 文译\n\n专注于将多语言 EPUB、FB2 或 TXT 小说翻译成中文,并尽量保留 EPUB 原排版、图片、目录和跳转。\n\n项目的日常入口只有一个命令:`translate`。它会完成预扫、分析、翻译、可选润色、章末审校、标点规范化和 EPUB 导出;中断后可以继续跑。\n\n## 快速开始\n\n```bash\nuv sync\nexport DEEPSEEK_API_KEY=sk-...\nuv run trans-novel translate book.epub\n```\n\n翻译完成后,默认会在源文件目录下生成译文 EPUB。运行状态、章节 JSON、术语库和报告会放在 `state/` 目录下。\n\n中断后继续:\n\n```bash\nuv run trans-novel resume book.epub\n```\n\n查看进度:\n\n```bash\nuv run trans-novel status book.epub\n```\n\n仅重新导出 EPUB:\n\n```bash\nuv run trans-novel tools assemble book.epub\n```\n\n## 输入和输出\n\n- 输入:EPUB、FB2、TXT。\n- 默认输出:中文 EPUB。\n- EPUB 输入会按原 XHTML 模板回填译文,尽量保留原书样式、图片、目录和锚点。\n- TXT 输入会生成新的 EPUB。\n- 需要纯文本时使用 `--format txt`。\n\n示例:\n\n```bash\nuv run trans-novel translate book.epub\nuv run trans-novel translate book.epub --format txt\nuv run trans-novel translate book.epub --chapter 3\n```\n\n## 常用开关\n\n```bash\nuv run trans-novel translate book.epub --polish\nuv run trans-novel translate book.epub --no-polish\nuv run trans-novel translate book.epub --qa\nuv run trans-novel translate book.epub --no-qa\n```\n\n`--polish/--no-polish` 会覆盖 `config.yaml` 里的 `pipeline.polish`。当前仓库的 `config.yaml` 写的是 `polish: true`,所以不加参数时默认会润色;代码层面的缺省值是 `false`,只在配置文件没写该字段时生效。\n\n润色会让每个翻译批次多一次 `strong` 档 LLM 请求,质量可能更稳,但会明显增加耗时和成本。已经翻译完成的批次会被断点续跑跳过,后来再开关润色不会自动重跑旧译文。\n\n## 配置\n\n主要配置都在 `config.yaml`:\n\n- `language.source`: `auto` 由模型识别源语言,也可以写死语言代码,如 `ja`、`en`、`ko`、`ru`、`de` 等。\n- `llm.tiers`: 配置 `strong`、`cheap`、`fast` 三档模型。\n- `pipeline.review`: 章末审校。\n- `pipeline.autofix_severe`: 对严重问题自动重译并采纳通过校验的结果。\n- `pipeline.polish`: 翻译后再做中文润色。\n- `pipeline.backtranslate_sample`: 回译抽检比例,`0` 为关闭。\n- `pipeline.consistency_qa`: 全书跨章一致性扫描。\n- `pipeline.book_understanding`: 翻译前预扫整本书,生成全书概览和逐章梗概。\n- `pipeline.rolling_context_segments`: 每批翻译时带入的前文译文段数。\n- `segment.max_chars_per_batch`: 每个翻译批次的大小。\n- `segment.max_chars_per_segment`: 超长段落的拆分阈值。\n\n离线测试或调试流程时,可以把 `llm.provider` 改成 `fake`,不会发网络请求。\n\n## 工作流程\n\n默认连续流程大致是:\n\n```text\n读取输入\n→ 解析章节、正文段落和 EPUB 目录\n→ 模型识别源语言(或使用配置指定语言)\n→ 预扫整本书,生成全书概览和逐章梗概\n→ 分析样章,建立初始术语表\n→ 按章、按批翻译\n→ 可选润色\n→ 标点规范化\n→ 章末 review\n→ 可选严重项自动重译\n→ 可选一致性 QA\n→ 回填导出 EPUB/TXT\n```\n\n每个批次翻译完成后都会写入 `state/`,所以长书中断后可以续跑。已经有译文的批次会跳过,只补未完成部分。\n\n## 一致性机制\n\n- **术语库**:人名、地名、专有名词和敬称会进入 SQLite 术语库,翻译时按配置注入提示词。\n- **全书理解**:翻译前预扫源文,生成全书概览和章节梗概,让早期章节也能参考全书走向。\n- **滚动上下文**:章内批次串行处理,后一个批次能看到前面最近几段译文。\n- **段数对齐**:每批输入 N 段,要求模型输出 N 段 JSON;段数不符会重试,仍失败则逐段兜底。\n- **章末 review**:按章检查漏译、误译、术语、人称等问题;默认只记录问题,是否自动修复由 `autofix_severe` 控制。\n- **标点规范化**:译文统一为简体中文大陆常用全角标点。\n\n## 常用工具\n\n```bash\nuv run trans-novel tools glossary book.epub list\nuv run trans-novel tools glossary book.epub conflicts\nuv run trans-novel tools qa book.epub\nuv run trans-novel tools report book.epub\nuv run trans-novel tools assemble book.epub\n```\n\n这些工具主要用于查看术语库、检查一致性、生成报告或重新导出成品。QA 和报告默认只汇总问题,不会自动改正文。\n\n## 模型档位\n\n默认配置使用 DeepSeek,并通过 OpenAI SDK 调用 `https://api.deepseek.com`。\n\n- `strong`: 翻译、润色、全局分析、标题翻译。\n- `cheap`: 章末 review、一致性 QA、回译比对。\n- `fast`: 全书预扫、章节梗概、术语抽取、回译等机械任务。\n\n如果模型 ID 变化,直接改 `config.yaml` 里的 `llm.tiers`。\n\n## 项目结构\n\n```text\ntrans_novel/\n ingest/ 输入解析、EPUB/FB2/TXT 切分\n llm/ LLM 抽象接口、DeepSeek provider、FakeClient\n glossary/ SQLite 术语库、抽取、冲突处理\n agents/ 分析、翻译、审校、润色、一致性、提示词\n pipeline/ 编排器、断点状态、滚动上下文、校验\n postprocess/ 标点规范化\n assemble/ EPUB/TXT 回填导出、QA 报告\ntests/ 离线测试\n```\n\n## 测试\n\n```bash\nUV_CACHE_DIR=/tmp/uv-cache uv run python -m unittest discover -s tests\n```\n\n如果本机 `uv` 缓存目录可写,也可以直接运行:\n\n```bash\nuv run python -m unittest discover -s tests\n```\n\n## 憧憬与不足\n\n本项目为作者个人兴趣所开发,仅在于针对长文本书籍的译介做出一份微薄的努力,未来想让翻译在够准确的前提下更加顺畅,努力从可读向好读迈进。现阶段翻译文本一些口头禅前后翻译不一致,专有名词翻译不准确的问题,已经改进!如果还有什么问题,可以提交issue,如果你有什么想法,欢迎在讨论区提出,如果你有一定的编程能力,欢迎给我提交PR,让这个项目变得更好。👏\n\n## 星标历史\n\n<a href=\"https://www.star-history.com/?repos=BigDawnGhost%2FWenyi&type=date&legend=top-left\">\n <picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&theme=dark&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <source media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <img alt=\"Star History Chart\" src=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n </picture>\n</a>\n"}, "e8dfee1e9187c17991aba08eca2f0f6afbcb1dce": {"t": 1785748711.6085455, "n": 4760, "h": "ecedc42a5d8495e1", "c": "# 文译\n\n专注于将多语言 EPUB、FB2 或 TXT 小说翻译成中文,并尽量保留 EPUB 原排版、图片、目录和跳转。\n\n项目的日常入口只有一个命令:`translate`。它会完成预扫、分析、翻译、可选润色、章末审校、标点规范化和 EPUB 导出;中断后可以继续跑。\n\n## 快速开始\n\n```bash\nuv sync\nexport DEEPSEEK_API_KEY=sk-...\nuv run trans-novel translate book.epub\n```\n\n翻译完成后,默认会在源文件目录下生成译文 EPUB。运行状态、章节 JSON、术语库和报告会放在 `state/` 目录下。\n\n中断后继续:\n\n```bash\nuv run trans-novel resume book.epub\n```\n\n查看进度:\n\n```bash\nuv run trans-novel status book.epub\n```\n\n仅重新导出 EPUB:\n\n```bash\nuv run trans-novel tools assemble book.epub\n```\n\n## 输入和输出\n\n- 输入:EPUB、FB2、TXT。\n- 默认输出:中文 EPUB。\n- EPUB 输入会按原 XHTML 模板回填译文,尽量保留原书样式、图片、目录和锚点。\n- TXT 输入会生成新的 EPUB。\n- 需要纯文本时使用 `--format txt`。\n\n示例:\n\n```bash\nuv run trans-novel translate book.epub\nuv run trans-novel translate book.epub --format txt\nuv run trans-novel translate book.epub --chapter 3\n```\n\n## 常用开关\n\n```bash\nuv run trans-novel translate book.epub --polish\nuv run trans-novel translate book.epub --no-polish\nuv run trans-novel translate book.epub --qa\nuv run trans-novel translate book.epub --no-qa\n```\n\n`--polish/--no-polish` 会覆盖 `config.yaml` 里的 `pipeline.polish`。当前仓库的 `config.yaml` 写的是 `polish: true`,所以不加参数时默认会润色;代码层面的缺省值是 `false`,只在配置文件没写该字段时生效。\n\n润色会让每个翻译批次多一次 `strong` 档 LLM 请求,质量可能更稳,但会明显增加耗时和成本。已经翻译完成的批次会被断点续跑跳过,后来再开关润色不会自动重跑旧译文。\n\n## 配置\n\n主要配置都在 `config.yaml`:\n\n- `language.source`: `auto` 由模型识别源语言,也可以写死语言代码,如 `ja`、`en`、`ko`、`ru`、`de` 等。\n- `llm.tiers`: 配置 `strong`、`cheap`、`fast` 三档模型。\n- `pipeline.review`: 章末审校。\n- `pipeline.autofix_severe`: 对严重问题自动重译并采纳通过校验的结果。\n- `pipeline.polish`: 翻译后再做中文润色。\n- `pipeline.backtranslate_sample`: 回译抽检比例,`0` 为关闭。\n- `pipeline.consistency_qa`: 全书跨章一致性扫描。\n- `pipeline.book_understanding`: 翻译前预扫整本书,生成全书概览和逐章梗概。\n- `pipeline.rolling_context_segments`: 每批翻译时带入的前文译文段数。\n- `segment.max_chars_per_batch`: 每个翻译批次的大小。\n- `segment.max_chars_per_segment`: 超长段落的拆分阈值。\n\n离线测试或调试流程时,可以把 `llm.provider` 改成 `fake`,不会发网络请求。\n\n## 工作流程\n\n默认连续流程大致是:\n\n```text\n读取输入\n→ 解析章节、正文段落和 EPUB 目录\n→ 模型识别源语言(或使用配置指定语言)\n→ 预扫整本书,生成全书概览和逐章梗概\n→ 分析样章,建立初始术语表\n→ 按章、按批翻译\n→ 可选润色\n→ 标点规范化\n→ 章末 review\n→ 可选严重项自动重译\n→ 可选一致性 QA\n→ 回填导出 EPUB/TXT\n```\n\n每个批次翻译完成后都会写入 `state/`,所以长书中断后可以续跑。已经有译文的批次会跳过,只补未完成部分。\n\n## 一致性机制\n\n- **术语库**:人名、地名、专有名词和敬称会进入 SQLite 术语库,翻译时按配置注入提示词。\n- **全书理解**:翻译前预扫源文,生成全书概览和章节梗概,让早期章节也能参考全书走向。\n- **滚动上下文**:章内批次串行处理,后一个批次能看到前面最近几段译文。\n- **段数对齐**:每批输入 N 段,要求模型输出 N 段 JSON;段数不符会重试,仍失败则逐段兜底。\n- **章末 review**:按章检查漏译、误译、术语、人称等问题;默认只记录问题,是否自动修复由 `autofix_severe` 控制。\n- **标点规范化**:译文统一为简体中文大陆常用全角标点。\n\n## 常用工具\n\n```bash\nuv run trans-novel tools glossary book.epub list\nuv run trans-novel tools glossary book.epub conflicts\nuv run trans-novel tools qa book.epub\nuv run trans-novel tools report book.epub\nuv run trans-novel tools assemble book.epub\n```\n\n这些工具主要用于查看术语库、检查一致性、生成报告或重新导出成品。QA 和报告默认只汇总问题,不会自动改正文。\n\n## 模型档位\n\n默认配置使用 DeepSeek,并通过 OpenAI SDK 调用 `https://api.deepseek.com`。\n\n- `strong`: 翻译、润色、全局分析、标题翻译。\n- `cheap`: 章末 review、一致性 QA、回译比对。\n- `fast`: 全书预扫、章节梗概、术语抽取、回译等机械任务。\n\n如果模型 ID 变化,直接改 `config.yaml` 里的 `llm.tiers`。\n\n## 项目结构\n\n```text\ntrans_novel/\n ingest/ 输入解析、EPUB/FB2/TXT 切分\n llm/ LLM 抽象接口、DeepSeek provider、FakeClient\n glossary/ SQLite 术语库、抽取、冲突处理\n agents/ 分析、翻译、审校、润色、一致性、提示词\n pipeline/ 编排器、断点状态、滚动上下文、校验\n postprocess/ 标点规范化\n assemble/ EPUB/TXT 回填导出、QA 报告\ntests/ 离线测试\n```\n\n## 测试\n\n```bash\nUV_CACHE_DIR=/tmp/uv-cache uv run python -m unittest discover -s tests\n```\n\n如果本机 `uv` 缓存目录可写,也可以直接运行:\n\n```bash\nuv run python -m unittest discover -s tests\n```\n\n## 憧憬与不足\n\n本项目为作者个人兴趣所开发,仅在于针对长文本书籍的译介做出一份微薄的努力,未来想让翻译在够准确的前提下更加顺畅,努力从可读向好读迈进。现阶段翻译文本一些口头禅前后翻译不一致,专有名词翻译不准确的问题,已经改进!如果还有什么问题,可以提交issue,如果你有什么想法,欢迎在讨论区提出,如果你有一定的编程能力,欢迎给我提交PR,让这个项目变得更好。👏\n\n## Star History\n\n<a href=\"https://www.star-history.com/?repos=BigDawnGhost%2FWenyi&type=date&legend=top-left\">\n <picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&theme=dark&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <source media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n <img alt=\"Star History Chart\" src=\"https://api.star-history.com/chart?repos=BigDawnGhost/Wenyi&type=date&legend=top-left&sealed_token=VFuKZdjDh-9e2mG4qlvqeSpCkWCoRf9ZRy0hIDLdaECFQeoNNlQ20QxSD4PuvTZp1RJg7J2s5hr57Eq66paMrhikuuI3kc41uZZCYb-bTqsUafeSB7AVdhw7bmz70NhkVXABHtSIHdw0DROZaInmznYJ651gP2klEeW8OOM8EkfJnXgDld6f0xn8mIJ9\" />\n </picture>\n</a>\n"}, "d3e12d65080750d960ec2ff4f7ef9ab9d233b793": {"t": 1785748712.6781015, "n": 3582, "h": "f214324c4e5aad5c", "c": "# 文译\n\n专注于将多语言 EPUB、FB2 或 TXT 小说翻译成中文,并尽量保留 EPUB 原排版、图片、目录和跳转。\n\n项目的日常入口只有一个命令:`translate`。它会完成预扫、分析、翻译、可选润色、章末审校、标点规范化和 EPUB 导出;中断后可以继续跑。\n\n## 快速开始\n\n```bash\nuv sync\nexport DEEPSEEK_API_KEY=sk-...\nuv run trans-novel translate book.epub\n```\n\n翻译完成后,默认会在源文件目录下生成译文 EPUB。运行状态、章节 JSON、术语库和报告会放在 `state/` 目录下。\n\n中断后继续:\n\n```bash\nuv run trans-novel resume book.epub\n```\n\n查看进度:\n\n```bash\nuv run trans-novel status book.epub\n```\n\n仅重新导出 EPUB:\n\n```bash\nuv run trans-novel tools assemble book.epub\n```\n\n## 输入和输出\n\n- 输入:EPUB、FB2、TXT。\n- 默认输出:中文 EPUB。\n- EPUB 输入会按原 XHTML 模板回填译文,尽量保留原书样式、图片、目录和锚点。\n- TXT 输入会生成新的 EPUB。\n- 需要纯文本时使用 `--format txt`。\n\n示例:\n\n```bash\nuv run trans-novel translate book.epub\nuv run trans-novel translate book.epub --format txt\nuv run trans-novel translate book.epub --chapter 3\n```\n\n## 常用开关\n\n```bash\nuv run trans-novel translate book.epub --polish\nuv run trans-novel translate book.epub --no-polish\nuv run trans-novel translate book.epub --qa\nuv run trans-novel translate book.epub --no-qa\n```\n\n`--polish/--no-polish` 会覆盖 `config.yaml` 里的 `pipeline.polish`。当前仓库的 `config.yaml` 写的是 `polish: true`,所以不加参数时默认会润色;代码层面的缺省值是 `false`,只在配置文件没写该字段时生效。\n\n润色会让每个翻译批次多一次 `strong` 档 LLM 请求,质量可能更稳,但会明显增加耗时和成本。已经翻译完成的批次会被断点续跑跳过,后来再开关润色不会自动重跑旧译文。\n\n## 配置\n\n主要配置都在 `config.yaml`:\n\n- `language.source`: `auto` 由模型识别源语言,也可以写死语言代码,如 `ja`、`en`、`ko`、`ru`、`de` 等。\n- `llm.tiers`: 配置 `strong`、`cheap`、`fast` 三档模型。\n- `pipeline.review`: 章末审校。\n- `pipeline.autofix_severe`: 对严重问题自动重译并采纳通过校验的结果。\n- `pipeline.polish`: 翻译后再做中文润色。\n- `pipeline.backtranslate_sample`: 回译抽检比例,`0` 为关闭。\n- `pipeline.consistency_qa`: 全书跨章一致性扫描。\n- `pipeline.book_understanding`: 翻译前预扫整本书,生成全书概览和逐章梗概。\n- `pipeline.rolling_context_segments`: 每批翻译时带入的前文译文段数。\n- `segment.max_chars_per_batch`: 每个翻译批次的大小。\n- `segment.max_chars_per_segment`: 超长段落的拆分阈值。\n\n离线测试或调试流程时,可以把 `llm.provider` 改成 `fake`,不会发网络请求。\n\n## 工作流程\n\n默认连续流程大致是:\n\n```text\n读取输入\n→ 解析章节、正文段落和 EPUB 目录\n→ 模型识别源语言(或使用配置指定语言)\n→ 预扫整本书,生成全书概览和逐章梗概\n→ 分析样章,建立初始术语表\n→ 按章、按批翻译\n→ 可选润色\n→ 标点规范化\n→ 章末 review\n→ 可选严重项自动重译\n→ 可选一致性 QA\n→ 回填导出 EPUB/TXT\n```\n\n每个批次翻译完成后都会写入 `state/`,所以长书中断后可以续跑。已经有译文的批次会跳过,只补未完成部分。\n\n## 一致性机制\n\n- **术语库**:人名、地名、专有名词和敬称会进入 SQLite 术语库,翻译时按配置注入提示词。\n- **全书理解**:翻译前预扫源文,生成全书概览和章节梗概,让早期章节也能参考全书走向。\n- **滚动上下文**:章内批次串行处理,后一个批次能看到前面最近几段译文。\n- **段数对齐**:每批输入 N 段,要求模型输出 N 段 JSON;段数不符会重试,仍失败则逐段兜底。\n- **章末 review**:按章检查漏译、误译、术语、人称等问题;默认只记录问题,是否自动修复由 `autofix_severe` 控制。\n- **标点规范化**:译文统一为简体中文大陆常用全角标点。\n\n## 常用工具\n\n```bash\nuv run trans-novel tools glossary book.epub list\nuv run trans-novel tools glossary book.epub conflicts\nuv run trans-novel tools qa book.epub\nuv run trans-novel tools report book.epub\nuv run trans-novel tools assemble book.epub\n```\n\n这些工具主要用于查看术语库、检查一致性、生成报告或重新导出成品。QA 和报告默认只汇总问题,不会自动改正文。\n\n## 模型档位\n\n默认配置使用 DeepSeek,并通过 OpenAI SDK 调用 `https://api.deepseek.com`。\n\n- `strong`: 翻译、润色、全局分析、标题翻译。\n- `cheap`: 章末 review、一致性 QA、回译比对。\n- `fast`: 全书预扫、章节梗概、术语抽取、回译等机械任务。\n\n如果模型 ID 变化,直接改 `config.yaml` 里的 `llm.tiers`。\n\n## 项目结构\n\n```text\ntrans_novel/\n ingest/ 输入解析、EPUB/FB2/TXT 切分\n llm/ LLM 抽象接口、DeepSeek provider、FakeClient\n glossary/ SQLite 术语库、抽取、冲突处理\n agents/ 分析、翻译、审校、润色、一致性、提示词\n pipeline/ 编排器、断点状态、滚动上下文、校验\n postprocess/ 标点规范化\n assemble/ EPUB/TXT 回填导出、QA 报告\ntests/ 离线测试\n```\n\n## 测试\n\n```bash\nUV_CACHE_DIR=/tmp/uv-cache uv run python -m unittest discover -s tests\n```\n\n如果本机 `uv` 缓存目录可写,也可以直接运行:\n\n```bash\nuv run python -m unittest discover -s tests\n```\n\n## 憧憬与不足\n\n本项目为作者个人兴趣所开发,仅在于针对长文本书籍的译介做出一份微薄的努力,未来想让翻译在够准确的前提下更加顺畅,努力从可读向好读迈进。现阶段翻译文本一些口头禅前后翻译不一致,专有名词翻译不准确的问题,已经改进!如果还有什么问题,可以提交issue,如果你有什么想法,欢迎在讨论区提出,如果你有一定的编程能力,欢迎给我提交PR,让这个项目变得更好。👏\n"}, "511ba19a8a926c9ab5194ec575ecf29484253435": {"t": 1785748713.9323277, "n": 3608, "h": "8601696a8a5b53fe", "c": "# 文译\n\n专注于将多语言 EPUB、FB2 或 TXT 小说翻译成中文,并尽量保留 EPUB 原排版、图片、目录和跳转。\n\n项目的日常入口只有一个命令:`translate`。它会完成预扫、分析、翻译、可选润色、章末审校、标点规范化和 EPUB 导出;中断后可以继续跑。\n\n## 快速开始\n\n```bash\nuv sync\nexport DEEPSEEK_API_KEY=sk-...\nuv run trans-novel translate book.epub\n```\n\n翻译完成后,默认会在源文件目录下生成译文 EPUB。运行状态、章节 JSON、术语库和报告会放在 `state/` 目录下。\n\n中断后继续:\n\n```bash\nuv run trans-novel resume book.epub\n```\n\n查看进度:\n\n```bash\nuv run trans-novel status book.epub\n```\n\n仅重新导出 EPUB:\n\n```bash\nuv run trans-novel tools assemble book.epub\n```\n\n## 输入和输出\n\n- 输入:EPUB、FB2、TXT。\n- 默认输出:中文 EPUB。\n- EPUB 输入会按原 XHTML 模板回填译文,尽量保留原书样式、图片、目录和锚点。\n- TXT 输入会生成新的 EPUB。\n- 需要纯文本时使用 `--format txt`。\n\n示例:\n\n```bash\nuv run trans-novel translate book.epub\nuv run trans-novel translate book.epub --format txt\nuv run trans-novel translate book.epub --chapter 3\n```\n\n## 常用开关\n\n```bash\nuv run trans-novel translate book.epub --polish\nuv run trans-novel translate book.epub --no-polish\nuv run trans-novel translate book.epub --qa\nuv run trans-novel translate book.epub --no-qa\n```\n\n`--polish/--no-polish` 会覆盖 `config.yaml` 里的 `pipeline.polish`。当前仓库的 `config.yaml` 写的是 `polish: true`,所以不加参数时默认会润色;代码层面的缺省值是 `false`,只在配置文件没写该字段时生效。\n\n润色会让每个翻译批次多一次 `strong` 档 LLM 请求,质量可能更稳,但会明显增加耗时和成本。已经翻译完成的批次会被断点续跑跳过,后来再开关润色不会自动重跑旧译文。\n\n## 配置\n\n主要配置都在 `config.yaml`:\n\n- `language.source`: `auto` 由模型识别源语言,也可以写死语言代码,如 `ja`、`en`、`ko`、`ru`、`de` 等。\n- `llm.tiers`: 配置 `strong`、`cheap`、`fast` 三档模型。\n- `pipeline.review`: 章末审校。\n- `pipeline.autofix_severe`: 对严重问题自动重译并采纳通过校验的结果。\n- `pipeline.polish`: 翻译后再做中文润色。\n- `pipeline.backtranslate_sample`: 回译抽检比例,`0` 为关闭。\n- `pipeline.consistency_qa`: 全书跨章一致性扫描。\n- `pipeline.book_understanding`: 翻译前预扫整本书,生成全书概览和逐章梗概。\n- `pipeline.rolling_context_segments`: 每批翻译时带入的前文译文段数。\n- `segment.max_chars_per_batch`: 每个翻译批次的大小。\n- `segment.max_chars_per_segment`: 超长段落的拆分阈值。\n\n离线测试或调试流程时,可以把 `llm.provider` 改成 `fake`,不会发网络请求。\n\n## 工作流程\n\n默认连续流程大致是:\n\n```text\n读取输入\n→ 解析章节、正文段落和 EPUB 目录\n→ 模型识别源语言(或使用配置指定语言)\n→ 预扫整本书,生成全书概览和逐章梗概\n→ 分析样章,建立初始术语表\n→ 按章、按批翻译\n→ 可选润色\n→ 标点规范化\n→ 章末 review\n→ 可选严重项自动重译\n→ 可选一致性 QA\n→ 回填导出 EPUB/TXT\n```\n\n每个批次翻译完成后都会写入 `state/`,所以长书中断后可以续跑。已经有译文的批次会跳过,只补未完成部分。\n\n## 一致性机制\n\n- **术语库**:人名、地名、专有名词和敬称会进入 SQLite 术语库,翻译时按配置注入提示词。\n- **全书理解**:翻译前预扫源文,生成全书概览和章节梗概,让早期章节也能参考全书走向。\n- **滚动上下文**:章内批次串行处理,后一个批次能看到前面最近几段译文。\n- **段数对齐**:每批输入 N 段,要求模型输出 N 段 JSON;段数不符会重试,仍失败则逐段兜底。\n- **章末 review**:按章检查漏译、误译、术语、人称等问题;默认只记录问题,是否自动修复由 `autofix_severe` 控制。\n- **标点规范化**:译文统一为简体中文大陆常用全角标点。\n\n## 常用工具\n\n```bash\nuv run trans-novel tools glossary book.epub list\nuv run trans-novel tools glossary book.epub conflicts\nuv run trans-novel tools qa book.epub\nuv run trans-novel tools report book.epub\nuv run trans-novel tools assemble book.epub\n```\n\n这些工具主要用于查看术语库、检查一致性、生成报告或重新导出成品。QA 和报告默认只汇总问题,不会自动改正文。\n\n## 模型档位\n\n默认配置使用 DeepSeek,并通过 OpenAI SDK 调用 `https://api.deepseek.com`。\n\n- `strong`: 翻译、润色、全局分析、标题翻译。\n- `cheap`: 章末 review、一致性 QA、回译比对。\n- `fast`: 全书预扫、章节梗概、术语抽取、回译等机械任务。\n\n如果模型 ID 变化,直接改 `config.yaml` 里的 `llm.tiers`。\n\n## 项目结构\n\n```text\ntrans_novel/\n ingest/ 输入解析、EPUB/FB2/TXT 切分\n llm/ LLM 抽象接口、DeepSeek provider、FakeClient\n glossary/ SQLite 术语库、抽取、冲突处理\n agents/ 分析、翻译、审校、润色、一致性、提示词\n pipeline/ 编排器、断点状态、滚动上下文、校验\n postprocess/ 标点规范化\n assemble/ EPUB/TXT 回填导出、QA 报告\ntests/ 离线测试\n```\n\n## 测试\n\n```bash\nUV_CACHE_DIR=/tmp/uv-cache uv run python -m unittest discover -s tests\n```\n\n如果本机 `uv` 缓存目录可写,也可以直接运行:\n\n```bash\nuv run python -m unittest discover -s tests\n```\n\n## 憧憬与不足\n\n本项目为作者个人兴趣所开发,仅在于针对长文本书籍的译介做出一份微薄的努力,未来想让翻译在够准确的前提下更加顺畅,努力从可读向好读迈进。现阶段翻译文本还会有一些口头禅前后翻译不一致,专有名词翻译不准确的问题,需要人工通读全文对这些小瑕疵进行干预,我会努力想办法改进。如果有什么问题,可以提交issue,如果你有什么想法,欢迎在讨论区提出,如果你有一定的编程能力,欢迎给我提交PR,让这个项目变得更好。👏\n"}}}} |