3 ms·
When I tried to translate this { "title":"hello" } I got { "título": "hola" } Why did it change the key?
by gl-prod 4y ago
When I tried to translate this
{
"title":"hello"
}
I got
{
"título": "hola"
}
Why did it change the key?
- deleted 4y ago[deleted]
- ravenstine 4y agoDepends on how they engineered the prompt. Doing it directly with ChatGPT was pretty straight forward. ``` The following is a piece of JSON where the values are strings in the English language. { "title":"hello" } Please translate the values into Spanish without altering the keys of the JSON object. ``` Responded with: ``` { "title":"hola" } ``` EDIT: Looks like this is the prompt being used: `Translate a i18n locale json content to ${targetLang}.` Just my opinion, that prompt needs improvement.
- travisjungroth 4y agoEven one example in the prompt would go a long way.
- DANmode 4y agoJust ask for what you want :]
- travisjungroth 4y agoI’m not sure what you mean. I’m saying that adding one example to the prompt given to ChatGPT would improve accuracy. In my experience, examples work better than instructions. The request and response that I replied to would be a fine starting point. It already gets across keys aren’t translated but values are. I’d add a few more entries to show other things like “match the punctuation/capitalization level” and “use the source text for untranslatable names”.
- basic_banana 4y agoI add some limit to the prompt and it is fixed temporally. I was thinking to transform the json struct to a flat struct with no keys before, but worrying about the structure it self can improve the accuracy of translation as context.
- quickthrower2 4y agoHave we given up on wrangling data and parsing because of "AI". Why not pull out the bit you want translated, and send just that to GPT?
- KMnO4 4y agoOr better yet, send it to Google Translate?