Skip to content

Preventing translation on nouns like person names using Translate

0

I am writing code to use the translate service for translating various documents. I am running into errors where it is also translating nouns and names as well, how to prevent it ?

asked a year ago224 views
2 Answers
1
Accepted Answer

Translate may not be able to dynamically detect proper nouns. Try following solution:

  1. Use Amazon Comprehend Entities to identify nouns, names - https://docs.aws.amazon.com/comprehend/latest/dg/how-entities.html

  2. In the source HTML content, specify translate="no" in HTML tags that surround the content that you don't want to translate: https://docs.aws.amazon.com/translate/latest/dg/customizing-translations-tags.html

AWS
EXPERT
answered a year ago
EXPERT
reviewed a year ago
EXPERT
reviewed a year ago
1

To prevent Amazon Translate from translating specific nouns like person names in your documents, you can use the "do-not-translate" feature. This feature allows you to specify certain parts of your text that should not be translated.

For HTML content, you can add the "translate" attribute with a value of "no" to the HTML tags surrounding the content you want to keep untranslated. For example:

<span translate="no">John Smith</span>

This approach works for both the Amazon Translate console and API operations.

When using the API, you can apply this feature to any type of HTML element to indicate content that should not be translated. This functionality is available for real-time API operations like TranslateText and TranslateDocument, as well as the asynchronous StartTextTranslationJob API operation.

By using this feature, you can ensure that important nouns, such as person names, remain in their original form while the rest of your document is translated. This helps maintain the accuracy and context of your translated content.

Remember to properly format your HTML content with these tags before sending it to Amazon Translate for processing. This way, you can effectively control which parts of your text are translated and which remain in their original form.
Sources
Using do-not-translate in Amazon Translate - Amazon Translate

answered a year ago
EXPERT
reviewed a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.