I would like to keep 'named entities' the same after passing through a custom translation model. What is the best way to do that?

The only method I can think of is to replace the named entities with a marker pre-translation, and then replace them back post-translation. I'm just wondering if there are other methods or recommendations for marker symbols that will scale and definitely won't be translated.

Thanks, Prasad

1

There are 1 answers

2
Atybzz On

Using the Google Translation API, if your text input is in HTML format, you can use the notranslate class to specify the portions of your text you would like to not have translated. For instance, if the input below is used and you set the target language to French, you can expect the following results:

Input:

For the given text <span class="notranslate">don’t translate this part</span>

Output:

Pour le texte donné <span class="notranslate">don't translate this part</span>