{"id":500,"date":"2020-11-07T16:21:06","date_gmt":"2020-11-07T16:21:06","guid":{"rendered":"https:\/\/machine-learning.webcloning.com\/2020\/11\/07\/amazon-translate-now-enables-you-to-mark-content-to-not-get-translated\/"},"modified":"2020-11-07T16:21:06","modified_gmt":"2020-11-07T16:21:06","slug":"amazon-translate-now-enables-you-to-mark-content-to-not-get-translated","status":"publish","type":"post","link":"https:\/\/salarydistribution.com\/machine-learning\/2020\/11\/07\/amazon-translate-now-enables-you-to-mark-content-to-not-get-translated\/","title":{"rendered":"Amazon Translate now enables you to mark content to not get translated"},"content":{"rendered":"<div id=\"\">\n<p>While performing machine translations, you may have situations where you wish to preserve specific sections of text from being translated, such as names, unique identifiers, or codes. We at the <a href=\"https:\/\/aws.amazon.com\/translate\/\" target=\"_blank\" rel=\"noopener noreferrer\">Amazon Translate<\/a> team are excited to announce a tag modifications that allows you to specify what text should not be translated. This feature is available in both the real-time <code>TranslateText<\/code> API and asynchronous batch <code>TextTranslation<\/code> API. You can tag segments of text that you don\u2019t want to translate in an HTML element. In this post, we walk through the step-by-step method to use this feature.<\/p>\n<h2>Using the translate-text operation in Command Line Interface<\/h2>\n<p>The following example shows you how to use the translate-text operation from the command line. This example is formatted for Unix, Linux, and macOS. For Windows, replace the backslash () Unix continuation character at the end of each line with a caret (^). At the command line, enter the following code:<\/p>\n<div class=\"hide-language\">\n<pre><code class=\"lang-bash\">aws translate translate-text \r\n--source-language-code \"en\" \r\n--target-language-code \"es\" \r\n--region us-west-2 \r\n--text \u201cThis can be translated to any language. &lt;p translate=no&gt;But do not translate this!&lt;\/p&gt;\u201d<\/code><\/pre>\n<\/div>\n<p>You can specify any type of HTML element to do so, for example, paragraph <code>&lt;p&gt;<\/code>, text section <code>&lt;span&gt;<\/code>, or block section <code>&lt;div&gt;<\/code>. When you run the command, you get the following output:<\/p>\n<div class=\"hide-language\">\n<pre><code class=\"lang-json\">{\r\n    \"TranslatedText\": \"Esto se puede traducir a cualquier idioma. &lt;p translate=no&gt;But do not translate this!&lt;\/p&gt;\",\r\n    \"SourceLanguageCode\": \"en\",\r\n    \"TargetLanguageCode\": \"es\"\r\n}<\/code><\/pre>\n<\/div>\n<h2>Using the span tag in Amazon Translate Console<\/h2>\n<p>In this example, we translate the following text from French to English:<\/p>\n<p>Mus\u00e9e du Louvre, c\u2019est ainsi que vous dites Mus\u00e9e du Louvre en fran\u00e7ais.<\/p>\n<p>You don\u2019t want to translate the first instance of \u201cMus\u00e9e du Louvre,\u201d but you do want to translate the second instance to \u201cLouvre Museum.\u201d You can tag the first instance using a simple span tag:<\/p>\n<div class=\"hide-language\">\n<pre><code class=\"lang-html\">Mus\u00e9e du Louvre, c'est ainsi que vous dites Mus\u00e9e du Louvre en fran\u00e7ais.<\/code><\/pre>\n<\/div>\n<p>The following screenshot shows the output on the Amazon Translate console.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-18064\" src=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2020\/11\/04\/Amazon-Translate-1.jpg\" alt=\"\" width=\"800\" height=\"298\"><\/p>\n<p>The following screenshot shows the output translated to Arabic.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-18065\" src=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2020\/11\/04\/Amazon-Translate-2.jpg\" alt=\"\" width=\"800\" height=\"300\"><\/p>\n<h2>Conclusion<\/h2>\n<p>In this post, we showed you how to tag and specify text that should not be translated. For more information, see the <a href=\"https:\/\/docs.aws.amazon.com\/translate\/latest\/dg\/what-is.html\" target=\"_blank\" rel=\"noopener noreferrer\">Amazon Translate Developer Guide<\/a> and <a href=\"https:\/\/aws.amazon.com\/translate\/resources\/\" target=\"_blank\" rel=\"noopener noreferrer\">Amazon Translate resources<\/a>. If you\u2019re new to Amazon Translate, try it out using our Free Tier, which offers 2 million characters per month for free for the first 12 months, starting from your first translation request.<\/p>\n<p>\u00a0<\/p>\n<hr>\n<h3>About the Author<\/h3>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"wp-image-11440 size-full alignleft\" src=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2020\/03\/20\/watson-srivathsan-100.jpg\" alt=\"\" width=\"100\" height=\"132\"><\/p>\n<p><strong>Watson G. Srivathsan<\/strong> is the Sr. Product Manager for Amazon Translate, AWS\u2019s natural language processing service. On weekends you will find him exploring the outdoors in the Pacific Northwest.<\/p>\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/aws.amazon.com\/blogs\/machine-learning\/amazon-translate-now-enables-you-to-mark-content-to-not-get-translated\/<\/p>\n","protected":false},"author":0,"featured_media":501,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[],"_links":{"self":[{"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/posts\/500"}],"collection":[{"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/comments?post=500"}],"version-history":[{"count":0,"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/posts\/500\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/media\/501"}],"wp:attachment":[{"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/media?parent=500"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/categories?post=500"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/tags?post=500"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}