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

用 GPT4 翻译电子书的体验

  •  
  •   Alicewish 2024-06-07 22:44:50 +08:00 3136 次点击
    这是一个创建于 490 天前的主题,其中的信息可能已经有所发展或是发生改变。

    继之前测试过用 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  
       2024-06-07 23:09:26 +08:00
    目前翻译一篇文章还行,翻译一本各章节上下有逻辑关系的书还是有点难为它了,无法保持原文的连贯性和逻辑性,常出现幻觉
    dasbn
        2
    dasbn  
       2024-06-07 23:11:48 +08:00
    感谢分享,我之前也想这么干,看到 op 的做饭,决定放弃。翻译出错太疼了,额度对书籍不太多。
    dasbn
        3
    dasbn  
       2024-06-07 23:12:11 +08:00
    @dasbn 做饭 -> 做法
    pluvet
        4
    pluvet  
       2024-06-08 12:48:42 +08:00
    可以尝试提取词汇表,加上 AI 自我监督,并且从翻译 HTML 改成翻译 AST (推荐 yaml 序列化)
    Alicewish
        5
    Alicewish  
    OP
       2024-06-08 13:34:41 +08:00
    @pluvet 你能不能自己做一本电子书翻译再看看你这几条的可行性?
    pluvet
        6
    pluvet  
       2024-06-08 13:47:55 +08:00
    @Alicewish 翻译了一本技术标准文档,两百多页,没啥问题
    pluvet
        7
    pluvet  
       2024-06-08 13:48:23 +08:00
    如果说技术文档被开除电子书籍,那我没话说了
    Alicewish
        8
    Alicewish  
    OP
       2024-06-08 14:32:31 +08:00
    @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  
       2024-06-08 15:40:52 +08:00
    所以我建议先转 ast 再预处理再翻译,你把这个直接丢给 AI 肯定不行。你不会真指望 AI 能自动帮你处理各种引用关系吧?
    https://imgur.com/a/CNxfYve
    googlefans
        10
    googlefans  
       2024-06-08 16:20:18 +08:00
    用 gpt4 翻译很不划算
    不如直接 google 翻译
    shakespark
        11
    shakespark  
       2024-06-08 17:13:20 +08:00
    4 用不起。3.5 可以啊
    metalvest
        12
    metalvest  
       2024-06-08 17:46:14 +08:00 via Android
    这是把 calibre 的翻译插件的翻译流程手动实现了一遍?
    HUZHUANGZHUANG
        13
    HUZHUANGZHUANG  
       2024-06-08 19:14:50 +08:00
    我直接开了一个微信读书会员,然后导入图书,开始翻译。还不限量
    Alicewish
        14
    Alicewish  
    OP
       2024-06-08 22:15:48 +08:00
    @googlefans 步骤 3 就是自动谷歌翻译啊。谷歌翻译整体可读性不如 GPT4 。
    Alicewish
        15
    Alicewish  
    OP
       2024-06-08 22:17:21 +08:00
    @metalvest 自动免费机翻的功能在我脚本里也有做,我需要的是无需额外付费的 GPT4 翻译,所以用半自动脚本。
    Alicewish
        16
    Alicewish  
    OP
       2024-06-08 22:18:44 +08:00
    @shakespark 3.5 和 4 质量差很大,如果我想制作质量较高的电子书翻译版,不会考虑 3.5 。再说 3.5 的 api 也是要花一点钱的。
    shakespark
        17
    shakespark  
       2024-06-09 09:53:24 +08:00
    @Alicewish 之前也比较过,感觉 3.5 和 4 差不了多少
    googlefans
        18
    googlefans  
       2024-06-09 16:27:20 +08:00
    planet888
        19
    planet888  
       2024-06-09 18:14:44 +08:00
    @pluvet 意思是文档可以转成 AST ?是我理解错了吗?有啥工具可以把文档转成 AST 吗
    Alicewish
        20
    Alicewish  
    OP
       2024-06-09 19:46:24 +08:00
    @shakespark 你对翻译文本的质量要求有点低
    OWLS
        21
    OWLS  
       2024-06-10 00:18:58 +08:00
    不断尝试,不断改进,之后你就是这方面的专家了。
    hectora
        22
    hectora  
       2024-06-11 19:50:59 +08:00 via iPhone
    直接用沉浸式翻译插件制作双语电子书就好了,3.5 翻译得还可以
    Alicewish
        23
    Alicewish  
    OP
       2024-06-12 00:29:09 +08:00
    @abcl8023y 3.5 离我的需求差比较多,我最终是希望人工校对后发布翻译版的,没必要用 3.5 当底稿增加自己校对的工作量。
    BQsummer
        24
    BQsummer  
       2024-06-12 19:44:05 +08:00
    题外话,推荐个今天刷到的吴恩达的翻译 agent ,https://github.com/andrewyng/translation-agent
    snylonue
        25
    snylonue  
       2024-06-14 17:36:31 +08:00
    https://github.com/ShenSheiBot/ebook-gpt-translator

    一个群友做的翻译工具,用过一次感觉挺好的
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     3850 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 34ms UTC 05:12 PVG 13:12 LAX 22:12 JFK 01:12
    Do have faith in what you're doing.
    ubao snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86