V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
爱意满满的作品展示区。
Alicewish
V2EX  ›  分享创造

用 GPT4 翻译电子书的体验

  •  
  •   Alicewish · 10 天前 · 1783 次点击

    继之前测试过用 GPT4O 阅读其他语种的漫画且效果还不错后,就考虑用 GPT4 进行英文电子书翻译了。为节约成本并提高可读性,使用网页版,也就是 3 小时限额 40 条的版本。之前没这么干是因为我经常要用 GPT4 改代码,不能消耗大量额度让自己要用的时候用不了,但既然 GPT4O 出来了且是分别计算额度的,就算 GPT4 额度用光也能暂时用 GPT4O 。

    目前翻译了两本悬疑小说,三本教程类书籍,一本学术类书籍,一本神话类书籍。

    流程是这样的:

    1. 提取电子书中的 html 类文件。
    2. 提取所有段落标签和标题标签。
    3. 先用谷歌翻译做一遍机翻,方便出 bug 时排查问题。
    4. 对提取的英文进行切分,保持每段切分在 2000 字符左右,总共会有 150 ~ 300 段切分。
    5. 每 3 小时进行 40 次提问。
    6. 完成提问并检查后打包成中文电子书。

    所以一本书大概要翻译一两天。

    目前遇到的问题:

    1. 受限于网络状况,回答不时出错或中断,使得自动化脚本半失效,需要经常人工检查。
    2. 审查很严重,连亲吻都会被屏蔽。这些部分需要手动处理。
    3. 会出现一些奇怪的 bug ,比如把 1990 年翻译成 1980 年,我刷了 4 遍才出来正确的 1990 年。
    4. 即便在同一对话中,人名也经常不能保持一致,且有时候人名会不翻译。
    5. GPT 有时候会把相邻的两段翻译成一段。
    6. 对于超长段落,没翻译完就停止,刷新依然如此。
    7. 有一些电子书里有大量的 a 标签,尤其是脚注多的书籍,很难处理。
    8. 翻译后的文本可能会丢失一部分标签,比如 a 标签和 span 标签。

    我不想发布未经人工校对的电子书的下载版,避免错误越传越广,但在不同平台尝试发长图结果大部分都被屏蔽了。目前考虑将全书内容做成一个带目录的长网页,找个地方放,方便我自己修改和管理可读性,但这又要费一番功夫了。

    我自己感兴趣的书主要是侦探、科幻、各领域历史、计算机这些类别的,之前因为看英文书太累了,好多书虽然买了却只看了一部分。

    25 条回复    2024-06-14 17:36:31 +08:00
    jiangjiaxingogog
        1
    jiangjiaxingogog  
       10 天前
    目前翻译一篇文章还行,翻译一本各章节上下有逻辑关系的书还是有点难为它了,无法保持原文的连贯性和逻辑性,常出现幻觉
    dasbn
        2
    dasbn  
       10 天前
    感谢分享,我之前也想这么干,看到 op 的做饭,决定放弃。翻译出错太疼了,额度对书籍不太多。
    dasbn
        3
    dasbn  
       10 天前
    @dasbn 做饭 -> 做法
    pluvet
        4
    pluvet  
       10 天前
    可以尝试提取词汇表,加上 AI 自我监督,并且从翻译 HTML 改成翻译 AST (推荐 yaml 序列化)
    Alicewish
        5
    Alicewish  
    OP
       10 天前
    @pluvet 你能不能自己做一本电子书翻译再看看你这几条的可行性?
    pluvet
        6
    pluvet  
       10 天前
    @Alicewish 翻译了一本技术标准文档,两百多页,没啥问题
    pluvet
        7
    pluvet  
       10 天前
    如果说技术文档被开除电子书籍,那我没话说了
    Alicewish
        8
    Alicewish  
    OP
       10 天前
    @pluvet 所以你没遇到过大量脚注,各种格式:斜体、粗体、下划线、居中,段落首字母特殊处理,诗文引用和链接引用等等。
    ```
    <p>"Still another <a href="@public@vhost@g@gutenberg@html@files@16464@[email protected]#footnote4_325" id="footnotetag4_325" class="pginternal" tag="{http://www.w3.org/1999/xhtml}a"><sup>4</sup></a>great, fierce<a href="@public@vhost@g@gutenberg@html@files@16464@[email protected]#footnote4_325" class="pginternal" tag="{http://www.w3.org/1999/xhtml}a"><sup>4</sup></a> company came to the same hill in Slane of Meath," macRoth continued. <a href="@public@vhost@g@gutenberg@html@files@16464@[email protected]#footnote5_325" id="footnotetag5_325" class="pginternal" tag="{http://www.w3.org/1999/xhtml}a"><sup>5</sup></a>"A battle-line with strange garments upon them,<a href="@public@vhost@g@gutenberg@html@files@16464@[email protected]#footnote5_325" class="pginternal" tag="{http://www.w3.org/1999/xhtml}a"><sup>5</sup></a> steadfast, without equal. A <a href="@public@vhost@g@gutenberg@html@files@16464@[email protected]#footnote6_325" id="footnotetag6_325" class="pginternal" tag="{http://www.w3.org/1999/xhtml}a"><sup>6</sup></a>comely,<a href="@public@vhost@g@gutenberg@html@files@16464@[email protected]#footnote6_325" class="pginternal" tag="{http://www.w3.org/1999/xhtml}a"><sup>6</sup></a> handsome, <a href="@public@vhost@g@gutenberg@html@files@16464@[email protected]#footnote7_325" id="footnotetag7_325" class="pginternal" tag="{http://www.w3.org/1999/xhtml}a"><sup>7</sup></a>matchless,<a href="@public@vhost@g@gutenberg@html@files@16464@[email protected]#footnote7_325" class="pginternal" tag="{http://www.w3.org/1999/xhtml}a"><sup>7</sup></a> untiring warrior in the van of this company; <a href="@public@vhost@g@gutenberg@html@files@16464@[email protected]#footnote8_325" id="footnotetag8_325" class="pginternal" tag="{http://www.w3.org/1999/xhtml}a"><sup>8</sup></a>the flower of every form, whether as regards hair, or eye, or whiteness; whether of size, or followers or fitness.<a href="@public@vhost@g@gutenberg@html@files@16464@[email protected]#footnote8_325" class="pginternal" tag="{http://www.w3.org/1999/xhtml}a"><sup>8</sup></a> Next to his skin a blue, narrow-bordered cloth, with strong, woven and twisted hoops of silvered bronze, with becoming, sharp-fashioned buttons of red gold on its slashes and breast-borders; a <a href="@public@vhost@g@gutenberg@html@files@16464@[email protected]#footnote9_325" id="footnotetag9_325" class="pginternal" tag="{http://www.w3.org/1999/xhtml}a"><sup>9</sup></a>green<a href="@public@vhost@g@gutenberg@html@files@16464@[email protected]#footnote9_325" class="pginternal" tag="{http://www.w3.org/1999/xhtml}a"><sup>9</sup></a> mantle, pieced together with the choicest of all colours, <a href="@public@vhost@g@gutenberg@html@files@16464@[email protected]#footnote10_325" id="footnotetag10_325" class="pginternal" tag="{http://www.w3.org/1999/xhtml}a"><sup>10</sup></a>folded about him;<a href="@public@vhost@g@gutenberg@html@files@16464@[email protected]#footnote10_325" class="pginternal" tag="{http://www.w3.org/1999/xhtml}a"><sup>10</sup></a> <a href="@public@vhost@g@gutenberg@html@files@16464@[email protected]#footnote11_325" id="footnotetag11_325" class="pginternal" tag="{http://www.w3.org/1999/xhtml}a"><sup>11</sup></a>a brooch of pale gold in the cloak over his breast;<a href="@public@vhost@g@gutenberg@html@files@16464@[email protected]#footnote11_325" class="pginternal" tag="{http://www.w3.org/1999/xhtml}a"><sup>11</sup></a> five circles of gold, <sup>*</sup><span class="sidenoteR">LL. fo. 99a.</span> that is, his shield, he bore on him; a tough, obdurate, straight-bladed sword for a hero's handling hung high on his left side. A straight, fluted spear, flaming red <a href="@public@vhost@g@gutenberg@html@files@16464@[email protected]#footnote12_325" id="footnotetag12_325" class="pginternal" tag="{http://www.w3.org/1999/xhtml}a"><sup>12</sup></a>and venomous<a href="@public@vhost@g@gutenberg@html@files@16464@[email protected]#footnote12_325" class="pginternal" tag="{http://www.w3.org/1999/xhtml}a"><sup>12</sup></a> in his hand." "But, who might that be?" asked <a id="Page_326" class="x-ebookmaker-pageno" title="326"></a> <span class="sidenoteL">W. 5342.</span> Ailill of Fergus. "Truly, we know him well," Fergus made answer. <a href="@public@vhost@g@gutenberg@html@files@16464@[email protected]#footnote1_326" id="footnotetag1_326" class="pginternal" tag="{http://www.w3.org/1999/xhtml}a"><sup>1</sup></a>"Fiery is the manner of the warlike champion who has so come thither.<a href="@public@vhost@g@gutenberg@html@files@16464@[email protected]#footnote1_326" class="pginternal" tag="{http://www.w3.org/1999/xhtml}a"><sup>1</sup></a> The choice flower of royal poets is he. He is the rush on the rath; he is the way to the goal; fierce is his valour, the man that came thither; Amargin son of the smith Ecetsalach ('the Grimy'), the noble poet from the Buas in the north, is he."</p>
    ```
    pluvet
        9
    pluvet  
       10 天前
    所以我建议先转 ast 再预处理再翻译,你把这个直接丢给 AI 肯定不行。你不会真指望 AI 能自动帮你处理各种引用关系吧?
    https://imgur.com/a/CNxfYve
    googlefans
        10
    googlefans  
       10 天前
    用 gpt4 翻译很不划算
    不如直接 google 翻译
    shakespark
        11
    shakespark  
       10 天前
    4 用不起。3.5 可以啊
    metalvest
        12
    metalvest  
       10 天前 via Android
    这是把 calibre 的翻译插件的翻译流程手动实现了一遍?
    HUZHUANGZHUANG
        13
    HUZHUANGZHUANG  
       10 天前
    我直接开了一个微信读书会员,然后导入图书,开始翻译。还不限量
    Alicewish
        14
    Alicewish  
    OP
       9 天前
    @googlefans 步骤 3 就是自动谷歌翻译啊。谷歌翻译整体可读性不如 GPT4 。
    Alicewish
        15
    Alicewish  
    OP
       9 天前
    @metalvest 自动免费机翻的功能在我脚本里也有做,我需要的是无需额外付费的 GPT4 翻译,所以用半自动脚本。
    Alicewish
        16
    Alicewish  
    OP
       9 天前
    @shakespark 3.5 和 4 质量差很大,如果我想制作质量较高的电子书翻译版,不会考虑 3.5 。再说 3.5 的 api 也是要花一点钱的。
    shakespark
        17
    shakespark  
       9 天前
    @Alicewish 之前也比较过,感觉 3.5 和 4 差不了多少
    googlefans
        18
    googlefans  
       9 天前
    planet888
        19
    planet888  
       9 天前
    @pluvet 意思是文档可以转成 AST ?是我理解错了吗?有啥工具可以把文档转成 AST 吗
    Alicewish
        20
    Alicewish  
    OP
       9 天前
    @shakespark 你对翻译文本的质量要求有点低
    OWLS
        21
    OWLS  
       8 天前
    不断尝试,不断改进,之后你就是这方面的专家了。
    abcl8023y
        22
    abcl8023y  
       7 天前 via iPhone
    直接用沉浸式翻译插件制作双语电子书就好了,3.5 翻译得还可以
    Alicewish
        23
    Alicewish  
    OP
       6 天前
    @abcl8023y 3.5 离我的需求差比较多,我最终是希望人工校对后发布翻译版的,没必要用 3.5 当底稿增加自己校对的工作量。
    BQsummer
        24
    BQsummer  
       6 天前
    题外话,推荐个今天刷到的吴恩达的翻译 agent ,https://github.com/andrewyng/translation-agent
    snylonue
        25
    snylonue  
       4 天前
    https://github.com/ShenSheiBot/ebook-gpt-translator

    一个群友做的翻译工具,用过一次感觉挺好的
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2926 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 12:40 · PVG 20:40 · LAX 05:40 · JFK 08:40
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.