RGJ
(Richard - Communiteq)
2025 年9 月 7 日 08:49
1
我们在两个不同的论坛上遇到了两个不同的问题,其中内容本地化开始将帖子翻译成其原始语言。
深入研究后,发现 locale detector 没有从 LLM 接收纯语言代码。
相反,它被 markdown ``` 包裹(仅复制日志中的相关部分以提高可读性
"delta":{"content":"```"}
"delta":{"content":"en```"},
或者它有周围的引号,可能是被提示中的 Output: \"en\" 混淆了。
"delta":{"content":"\""}
"delta":{"content":"en\""}
将提示的最后一行更改为 Your response must be a language code, and nothing else. Do not wrap your response in markdown. 有所帮助,但我猜 LanguageDetector.detect 应该在清理答案后(也许只允许 AZaz 和 -?)再使用它。
4 个赞
nat
(Natalie T)
2025 年11 月 4 日 03:21
5
@RGJ 我们有一个针对此的 PR,但您能分享一下您正在使用什么 LLM 吗?
1 个赞
RGJ
(Richard - Communiteq)
2025 年11 月 4 日 06:14
7
我们已停用该实例,但据我回忆,它是 Ministral 3B。
nat
(Natalie T)
2025 年11 月 5 日 10:17
8
我在这里合并了一个修复程序,其中包括更新提示并将示例从系统提示移到适当的交互中。
main ← sanitise-locale-detection
opened 11:37AM - 03 Nov 25 UTC
This commit improves the prompt, and also matches the return value against this:…
- https://datatracker.ietf.org/doc/html/rfc5646#section-2.2.1
- **Primary Language Subtag**: ... Two-character primary language subtags were defined in the IANA registry according to the assignments found in the standard "ISO 639-1:2002 ...
- **Extended Language Subtags**: ... Extended language subtags consist solely of three-letter subtags.
Meta: https://meta.discourse.org/t/locale-detector-return-value-issues/381852
我们的团队目前正在进行评估,以提高跨各种 LLM 的可靠性。
2 个赞