Ask HN: 你用 LLM 做 HTML 翻译吗?
1 分•作者: Mooty•6 个月前
我遇到一个好问题,但解决起来相当棘手,那就是将 HTML 页面翻译成任何人类语言。<p>我开始尝试 DeepL,它提供了这个功能,但结果差强人意,因为你无法向它提供任何上下文。<p>所以,对我来说,这显然是 LLM 的用武之地。在精心设计了一个好的上下文提示后,我尝试了 OpenAI 的 o4-mini,结果几乎完美。<p>然而,涉及到业务方面,我需要更快地完成这项工作,因为一个大约 100KB 的页面需要一分钟才能生成,这对于最终用户来说太长了。<p>我稍微优化了一下内容(只发送感兴趣的 HTML 部分),但最终速度仍然很慢(超过 10 秒)。
我正在考虑将 HTML 转换为 JSON,并在翻译后再转换回来,这样可能会更快。<p>有没有人也这样做?或者对于这个问题,谁有更好的 API/LLM 性能方面的见解?
查看原文
I've came accross a good but quite hard problem to solve which is to translate HTML pages into whatever human langage.<p>I've started tinkering with DeepL which proposes this feature but results are quite off the rails because you cannot provide any context to it.<p>So well, it was a clear case for an LLM to me. After crafting a good context prompt, I've tried o4-mini from OpenAI and it's results are nearly perfect.<p>However came business around and I need to be able to this WAY faster, as a ~100ko page will take like a minute to generate, which is way too long for the end user.<p>I've optimised content a little (sending only html parts that are interesting) but it's still quite slow in the end (more than 10s).
I'm thinking about translating html to json and do it back after translation, so it might be faster.<p>Does anyone do this as well ? Or has any insight of a better performing API/LLM for this problem ?