The completion does not always follow the rule set in prompt when it is required to translate an article

Hi all,

I am trying translating an Japanese article into Taiwanese mandarin written in traditional chinese characters, though the result is always mixture of paragraph in different languages, such as English, Japanese, Cantonese, Vietnamese.

My prompt is f"Translate the following Japanese text into Taiwanese Mandarin, using Traditional Chinese characters: {text}"

Any suggestion is welcome, thanks!

Hi there,

Have you tried to use the Chat endpoint instead of the Completion endpoint ?
Chat uses GPT3.5 which gives much better results than davinci for some tasks and my experience is that it is much better at following specific instructions.

Use the “system” role to specify your instruction.

this would look like a chat completion with the following input as an array

[{role: “system”, content: Translate the following Japanese text into Taiwanese Mandarin, using only Traditional Chinese characters"},
{role: “user”, content:}]

you can try it in the playground first → OpenAI API

I did and it looks fine (although I don’t speak a word of Mandarin and little japanese)

Hope this helps.

Thanks! Let me see if it works and I will get back to you.

Hi elsiokun,

Thank you for the reply. The result looks good, though my input text is about 2000 Japanese characters. It will be more convenient if the work can be done by a python script. Perhaps I can only use copy-and-paste in this stage until openai team improve their api setting?
Thank you anyway!

You can already use the chat endpoint through the APIs using a python script.
I suppose you could slice the original articles in paragraphs and translate each paragrah…

This documentation should help you do that → Chat Endpoint Example

Thank you. Actually my python script was generated by chatgpt 4.0. Maybe I need to give it more hints to generate a script based on chat endpoint.