gabriel
gabriel

Reputation: 345

Training / using OpenAI GPT-3 for translations

I'm trying to use OpenAI for translation of my products descriptions from one language to some other languages (EN, DE, CZ, SK, HU, PL, SI...). The translations, especially to SK/CZ/HU/PL languages are (mainly gramatically) quite bad (using text-davinci-003 model). I've got an idea - I already have a few thousands of similar products fully translated into all of these languages by professional translators. Is it possible to use those existing correct translations to train GPT-3 and then use this model to translate new texts? Has anybody already tried something similar?

Upvotes: 1

Views: 568

Answers (1)

Aniket Artani
Aniket Artani

Reputation: 21

I have utilized OpenAI to translate texts between languages, and the results have been quite impressive.

def translate_text(text, target_language): 
    response = openai.Completion.create( 
        engine="gpt-3.5-turbo-instruct", 
        prompt=f"Translate the following text into {target_language}: {text}\n", 
        max_tokens=60, 
        n=1, 
        stop=None, 
        temperature=0.7, 
        ) 
    return response.choices[0].text.strip()

Upvotes: 0

Related Questions