---
title: "How to improve translation quality when using OpenAI's language model?"
description: "Learn how to give translation context to improve the translations generated with a LLM."
canonical: "https://www.codeandweb.com/babeledit/knowledgebase/pass-translation-context-to-ai"
product: "babeledit"
source: "html"
---

# How to improve translation quality when using OpenAI's language model?

When using OpenAI's large language models for machine translation, sometimes not only the source text is translated, but markup can also be altered unexpectedly - or some text may remain untranslated if it is mistaken for markup.

**Example:**

```
en-US (source): "<1>File copied.</1> {Close}"
de-DE (OpenAI): "<1>Datei kopiert.<\/1> {Close}"
```

Here, the closing tag `</1>` has an extra backslash, and the text inside the braces `{Close}` wasn’t translated.

To fix this, you can provide a _context string_ to the translation service. Click **Configuration** in the toolbar and enter the following **Context** in the **Machine translation** section:

```
<\/0><\/1> are incorrect, return them as </0></1>.
Translate text inside {}.
```

With this context, the translation will correctly preserve markup and translate the text inside braces:

```
en-US (source): "<1>File copied.</1> {Close}"
de-DE (OpenAI): "<1>Datei kopiert.</1> {Schließen}"
```

## Structured data

```json
{
  "@context": "https://schema.org",
  "@type": "TechArticle",
  "headline": "How to improve translation quality when using OpenAI's language model?"
}
```
