Connect with us


How NSF’s iHARP researchers are enabling active learning for polar ice analysis using Amazon SageMaker and Amazon A2I

The University of Maryland, Baltimore County’s Bina lab is a multidisciplinary research lab for employing advanced computer vision, machine learning (ML), and remote sensing techniques to discover new knowledge of our environment, especially in the Arctic and Antarctic regions. The lab’s work is supported by NSF BIGDATA awards (IIS-1947584, IIS-1838230), the NSF HDR Institute award…



The University of Maryland, Baltimore County’s Bina lab is a multidisciplinary research lab for employing advanced computer vision, machine learning (ML), and remote sensing techniques to discover new knowledge of our environment, especially in the Arctic and Antarctic regions. The lab’s work is supported by NSF BIGDATA awards (IIS-1947584, IIS-1838230), the NSF HDR Institute award (OAC-2118285), and the Amazon ML research award for climate change. Recently, the Bina Lab was awarded by National Science Foundation’s Harnessing the Data Revolution (NSF HDR) to support the institute for Harnessing Data and Model Revolution in the Polar Regions (referred to as iHARP). To learn more and contribute to ML research activities, visit iHARP’s website at

iHARP collaborates actively with NASA, Amazon Research, and AWS to conduct advanced research in data analysis and modeling in the Arctic and Antarctic regions using data science, ML, and AI. The team of scientists at iHARP, under the leadership of Dr. Maryam Rahnemoonfar and Dr. Masoud Yari, are working to uncover data insights on trends related to the thickness of the ice sheets, the level of snow accumulation, and the melt velocity. All of these factors provide important indicators on climate change patterns. The process of data collection and preparation continues to be highly labor intensive in spite of significant technological advancements in remote sensing techniques. The challenges are exacerbated by the need to sift through massive volumes of images collected over years to detect meaningful pattern changes. Furthermore, images of varying quality introduce degradation in the analysis process. While training local semantic segmentation and contour detection models, the iHARP researchers were unable to extract the layer boundary and contour predictions with the accuracy they needed in spite of comprehensive image preprocessing tasks.

With the democratization of technologies making it possible to run deep learning training in the cloud at a fraction of the cost and time compared to on-premises, the iHARP researchers decided to build their ML workflows on Amazon SageMaker. This enabled the team to address scalability requirements, improve their existing auto-labeling models, and accelerate active learning with human in the loop, which enabled collaboration among domain scientists and data scientists. The end goal was to make polar ice layer tracking more accurate and less time-consuming. In this post, we document the results of the collaboration between researchers at iHARP and AWS to solve the Arctic ice analysis use case. Specifically, we walk you through the following topics:

  • What is Arctic ice analysis?
  • An approach for using ML for Arctic ice analysis
  • Scalable ML with SageMaker
  • Active learning workflow with Amazon Augmented AI (Amazon A2I) and SageMaker

What is Arctic ice analysis?

Glaciology is a branch of environmental science focusing on ice and its properties. 71% of our planet is made up of water, so ice has an important role to play in impacting the global climate (more on the topic can be found in Six ways loss of Arctic ice impacts everyone). The melting of polar ice caps (Arctic and Antarctic) leads to our planet being exposed to increased heat because we now have less ice to reflect heat back into space. When ice melts, it causes an increase in sea level rise (SLR), which is a global concern. Rising water levels can lead to dangerous floods, especially in coastal areas and islands.

Per a United Nations 2019 study, people have an average life span of 72.6 years. Our time on this planet is limited. According to the article Ice core basics, we have access to ice core (cylindrical blocks drilled through ice sheets, with the youngest ice layer on top and the oldest layer at the bottom) records that go back by at least 800,000 years. For research to be effective, we need to access and analyze as much data as we can to uncover relationships between ice layer pattern changes and past climatic events. However, it is mathematically impossible for us to analyze all the data available. This is where ML and AI come in to lend a neural net or two to speed things up!

So, what do we really mean by analysis of ice data? It is the labor-intensive process of going through millions or even billions of radar, spectroscopic, photographic images, tabular data, and climatology data to map out ice layers, look for changes in ice layers over time, identify climatic events, and find patterns that prove the relationship between what happens to ice and its effect on the climate. To accelerate this task, we need a powerful computer, the ability to read, understand, and interpret images, the ability to look for seemingly minuscule changes in these images that happen gradually through thousands of images, the ability to relate these changes to events noticeable in mathematical, tabular, and sensor readings, and more. With the recent advancements in ML algorithms and techniques, and the availability of supercomputers at a fraction of the cost with cloud computing, scientists are eager to take advantage of cloud-based ML to explore and mine Arctic and Antarctic data.

One of the first and perhaps most important steps in the Arctic ice analysis process is to distinguish the different layers of ice with considerable accuracy. This is because this step informs the rest of the steps in the process. We can achieve this by training an ML model using supervised learning to detect ice layers from radar images, for example. To get to the accuracy we need, we require large amounts of annotated data. The challenge was not the availability of data; there is a large amount of heterogeneous radar data from the polar regions that has been gathered through expensive missions. However, during our experimentation, we realized that the quality of annotations for this data wasn’t sufficient to train a model with the accuracy we needed. In the next few sections, we walk you through how we solved this challenge.

An approach for Arctic ice analysis using ML

In the IEEE Big Data conference in 2019, our researchers, Dr. Maryam and Dr. Masoud, along with colleagues from University of Kansas and University of Colorado, published the paper Smart Tracking of Internal Layers of Ice in Radar Data via Multi-Scale Learning. This paper detailed experimentation using ML, specifically edge detection models using multi-scale deep learning models (such as Holistically-Nested Edge Detection (HED)), to track the layer boundaries in radar images of ice layers. The extended version of this research is published in Deep multi-scale learning for automatic tracking of internal layers of ice in radar data in the Journal of Glaciology in 2020.

NASA has been gathering data from polar regions for many decades. NASA’s ICESat and ICESat-2 and Operation IceBridge are prominent examples of those efforts. Operation IceBridge was conducted as a bridge between the two ICESat missions for 11 years to collect polar surveys using airborne sensors, such as radar. The benefit of using radar sensors is that its waves can penetrate underneath the ice surface. However, this data represents a snapshot in time, and is tied to geospatial coordinates. Operation IceBridge provided petabytes of publicly available raw data, and manual analysis was a huge challenge. For example, the following figure displays a radar image segment that was collected in Greenland in 2012. The horizontal direction is the flight track, and the vertical direction is the depth of snow. The units per image pixel are displayed on the image.

The following figure shows the same image with the layer annotations that were drawn manually. The very first boundary line (marked as Layer-1) is the snow surface; each consecutive layer underneath it represents the annual accumulation of snow in previous years. Our goal is to detect the layers and eventually calculate the thickness of layers, but this was only for one segment of just one frame! We wanted to be able to scale and map the ice layers across all of Greenland!

Essentially, we want our models to be able to predict all the layers, as depicted in the following figure (which includes the original image and an annotated image of all the layers). This is an example of an image with very tight and faded layers. However, there are other problems to watch out for, such as noise and artifacts, the discussion of which is outside the scope of this post.

In summary, in their IEEE 2019 and JOG 2020 paper, the researchers recorded the following observations from their experiments on the efficacy of using deep learning for radar image labeling:

  • Most of the well-known deep learning approaches work very well on normal images, but weren’t found to produce acceptable results in the presence of noise. The fact that deep learning models aren’t robust with respect to noise is discussed in various works.
  • Transfer learning approaches don’t work well for radar images, whereas training from scratch yields far better results.
  • Training from scratch requires annotated data provided by the domain experts. Generating good synthetic data might be a solution for lack of annotated data.

Based on these observations, we realized we needed to account for certain considerations:

  • Our dataset during experimentation would be of low size (approximately 5,000 images). However, we needed to future proof the architecture to scale on demand.
  • We needed to weave in our existing semi-automatic solution for layer tracking (using the model mentioned in the IEEE paper).
  • The approach should use a partially annotated dataset we had (we don’t have the time or resources to human annotate the dataset fully).
  • We needed the ability to deploy an active learning framework such that the model can evolve by using feedback from human reviewers. The active learning approach would find a middle ground allowing domain scientists to modify model predictions.

The end goal was of course to maximize the model accuracy in layer predictions.

Scalable ML with SageMaker

SageMaker is a fully managed ML service. SageMaker provides an integrated Jupyter environment for authoring and experimentation, and a web-based visual interface called SageMaker Studio, where you can perform all ML development steps with complete access, control, and visibility. SageMaker provisions and manages the infrastructure required for training and hosting. SageMaker also provides common ML algorithms that are optimized to run efficiently against extremely large data in a distributed environment. With native support for bring-your-own-algorithms and frameworks, SageMaker offers flexible distributed training options that adjust to customized workflows. Training and hosting are billed by minutes of usage, with no minimum fees and no upfront commitments.

We found SageMaker well suited for our requirements due to its ability to scale, its flexibility in supporting our custom ML algorithms, the fact that we could get started quickly due to ease of use, and more importantly the ability to set up active learning using Amazon A2I. To continue experiments with our semantic segmentation model using SageMaker, we designed the following architecture.

Download and preprocess images

We use publicly available data. For training our model, we used radar data available on the National Snow & Ice Data Center. Partial annotations of the ice layers are available for use. However, not all layers are present in the annotation, which may skew the results. As a first step, we downloaded the raw dataset into an Amazon Simple Storage Service (Amazon S3) bucket. We provisioned a SageMaker Jupyter notebook, with which we retrieved the images, and converted them into the RecordIO format, which optimizes storage and enables streaming data in pipe mode for faster training. The RecordIO files are then uploaded back to Amazon S3 as train and test datasets.

Train the multi-scale layer tracking model on SageMaker

We created a Python file as an entry point that contained the code for our multi-scale layer tracking algorithm. We used the SageMaker MXNet estimator as a wrapper for our CNN, and we used the SageMaker Python SDK for initializing the estimator, configuring the hyperparameters, and running the training. We performed hyperparameter optimization with the SageMaker automatic model tuner to determine the optimal settings that gave us the best results.

Host the model on SageMaker and run predictions

When the model training was complete, the artifacts were automatically sent to an S3 bucket by SageMaker. Before we could run bulk prediction of annotations for our images, in the experimental stage we wanted to set up a real-time endpoint, run tests on prediction quality, and enable active learning. To set up real-time inference, we first created the model package, then created an endpoint configuration that specified the instance type we wanted for hosting, along with details on whether we wanted to run multiple versions at the same time. We didn’t select this option as we were in the experimental stage, but for more details, see Deploy a Model in Amazon SageMaker. Finally, we created the endpoint. For running predictions, we used a preprocessed test dataset of images that we sent to the hosted endpoint. The model returned the JSON annotations for the layer boundaries from our input image, and we persisted the annotation coordinates and the image into an S3 bucket.

Of course, bringing our model to SageMaker was the initial step, but this gave us the foundation we needed to quickly innovate and accelerate our experimentation. In the next section, we walk you through how we used Amazon A2I with SageMaker to create a fully functional active learning workflow.

Set up an active learning workflow with Amazon A2I

Amazon A2I makes it easy to add human review into your ML workflow. Amazon A2I provides built-in human review workflows for common ML use cases, such as content moderation and text extraction from documents. You can also create your own workflows for ML models built on SageMaker or any other tools. With Amazon A2I, you can allow human reviewers to step in when a model is unable to make a high-confidence prediction or audit its predictions on an ongoing basis. Amazon A2I provides pre-built templates to create task UI pages for reviewing audio, images, text, and video, and you can customize the templates for your needs. For our use case, we created a custom liquid template using a crowd-polyline element. This enabled implementation of active learning because human reviewers (our researchers) could now interact with a task UI (a webpage) to complete the following steps:

  1. Evaluate the original partially annotated input image.
  2. Compare the predicted annotations from the model with the original partially annotated input image.
  3. Use the interactive task UI to update or modify the predicted annotations and image, and submit for retraining.

First, we walk you through how to set up a human review with Amazon A2I. Then we show you how to enable retraining and complete the active learning workflow.

Create a worker task template

First ensure all Amazon A2I prerequisites are met. This includes setting up S3 buckets for input and output, AWS Identity and Access Management (IAM) roles, and a workforce for the human review workflows.

Next, we create the task UI using a worker task template in SageMaker. The worker task template is an HTML file that allows the UI to be tailored to fit the human review use case. To get started, SageMaker includes a wide range of HTML components for building a custom worker UI. For this use case, we need the reviewer to be able to update line segments on the UI that correspond to snow layers in an image. We chose to use the crowd-form and crowd-polyline elements. The crowd-form element provides basic controls for the UI, such as submitting results. The crowd-polyline element allows the user to interact with line segments on the UI, which is used to fit lines on the individual snow layers.

Now that we have identified the UI components to use, we need to include the model data to interact with via the UI. The crowd-polyline component includes fields for populating the initial value, labels, and source image. These fields are used to populate the snow layer data as well as the image of the snow layers. After the worker UI is rendered, the reviewer can edit and add additional line segments. To aid the reviewer, we also included the original model output and labeled input images alongside the crowd-polyline editor.

The following screenshot shows the task UI when activated.

The following is a code snippet of the template:

Model Output

Labeled Input

Create the human review workflow

With the task template complete, we move on to creating the human review workflow. This specifies the following:

  • The workforce that tasks are sent to
  • The task template created in the previous step
  • The result output location

We can create the workflow via API or the Amazon A2I console. See Create a Human Review Workflow for details.

Start human review loops

At this point, we have our task template and human review workflow created, which defines how we want our review UI to look and function. Starting human review loops is the last step in the Amazon A2I process. For each set of labeled data and images, we create a human review loop to create the environment for our workforce reviewers. See Create and Start a Human Loop for a Custom Task Type for details.

The individual reviewers create an account and log in to perform any reviews that have been created. Then they select from a list of tasks assigned to them, as seen in the following screenshot.

After selecting a task, they see the task UI that was built using the custom HTML components. Finally, the user submits their updates after fitting the polylines to the snow layers.

Enable retraining

The following diagram shows the updated architecture with active learning implemented.

Now that the human review loop is in place to modify annotations, we need to send the results back to the process for implementing automated retraining after a critical mass of images have been corrected by the reviewers. When we complete this step, our architecture is fully enabled for active learning. In our case, we decided that retraining should be triggered after every 100 image corrections. The images with the corrected annotations overlaid are stored in an S3 bucket, and we also store the annotation coordinates along with their corresponding S3 image prefix in an Amazon DynamoDB table for easy retrieval and indexing.

Conclusion and next steps

In this post, we walked through how we used SageMaker and Amazon A2I to set up an active learning ML workflow for improving annotation accuracy of Arctic ice layer tracking. This is an ongoing experimentation for us, and we plan to publish a companion post to share the results in the form of a highly accurate annotated dataset of polar ice layers. We are always on the lookout for collaborators, so if this sounds interesting, look us up at or leave us feedback in the comments.

About the Authors

Prem Ranga specializes in ML and AI at AWS with a passion in helping customers solve NLP, CV and deep learning problems. Prem built the Alexa controlled beer stations in Houston and other locations. Prem is a Packt author. You can read about this and other publications at

Dr. Maryam Rahnemoonfar is a Tenured Associate Professor of AI at UMBC. Her research interests include Deep Learning, Computer Vision, Data Science, AI for Social Good, Remote Sensing, and Document Image Analysis. Her research specifically focuses on developing novel machine learning and computer vision algorithms for heterogeneous sensors such as Radar, Sonar, Multi-spectral, and Optical. Her research has been funded by several awards including NSF BIGDATA award, Amazon Academic Research Award, Amazon Machine Learning award, and IBM. She serves as the Principal Investigator for iHARP.

Dr. Masoud Yari is a research professor at iHARP Data Science institute and Bina lab at College of Engineering and Information Technology, University of Maryland, Baltimore County, MD. His research interests include machine learning, computer vision, remote sensing, mathematical modeling, and dynamical systems. He is passionate about discovering actionable insights in data and leading interdisciplinary research teams and projects to solve environmental and humanitarian problems.

Brett Seib is an AWS Enterprise Solutions Architect based out of Austin, TX. He is passionate about innovating and solving business challenges with customers. Brett has several years of experience in the IoT and Data Analytics industries helping customers innovate with data.

Morgan Dutton is an AWS Technical Program Manager with the Amazon Augmented AI and Mechanical Turk team based in Seattle, WA. She works with academic and public sector customers to accelerate their use of human-in-the-loop ML services. Morgan is especially interested in collaborating with academic customers to support adoption of ML technologies by researchers, students, and educators.


Continue Reading
Click to comment

Leave a Reply

Your email address will not be published.


Customize pronunciation using lexicons in Amazon Polly

Amazon Polly is a text-to-speech service that uses advanced deep learning technologies to synthesize natural-sounding human speech. It is used in a variety of use cases, such as contact center systems, delivering conversational user experiences with human-like voices for automated real-time status check, automated account and billing inquiries, and by news agencies like The Washington…




Amazon Polly is a text-to-speech service that uses advanced deep learning technologies to synthesize natural-sounding human speech. It is used in a variety of use cases, such as contact center systems, delivering conversational user experiences with human-like voices for automated real-time status check, automated account and billing inquiries, and by news agencies like The Washington Post to allow readers to listen to news articles.

As of today, Amazon Polly provides over 60 voices in 30+ language variants. Amazon Polly also uses context to pronounce certain words differently based upon the verb tense and other contextual information. For example, “read” in “I read a book” (present tense) and “I will read a book” (future tense) is pronounced differently.

However, in some situations you may want to customize the way Amazon Polly pronounces a word. For example, you may need to match the pronunciation with local dialect or vernacular. Names of things (e.g., Tomato can be pronounced as tom-ah-to or tom-ay-to), people, streets, or places are often pronounced in many different ways.

In this post, we demonstrate how you can leverage lexicons for creating custom pronunciations. You can apply lexicons for use cases such as publishing, education, or call centers.

Customize pronunciation using SSML tag

Let’s say you stream a popular podcast from Australia and you use the Amazon Polly Australian English (Olivia) voice to convert your script into human-like speech. In one of your scripts, you want to use words that are unknown to Amazon Polly voice. For example, you want to send Mātariki (Māori New Year) greetings to your New Zealand listeners. For such scenarios, Amazon Polly supports phonetic pronunciation, which you can use to achieve a pronunciation that is close to the correct pronunciation in the foreign language.

You can use the Speech Synthesis Markup Language (SSML) tag to suggest a phonetic pronunciation in the ph attribute. Let me show you how you can use SSML tag.

First, login into your AWS console and search for Amazon Polly in the search bar at the top. Select Amazon Polly and then choose Try Polly button.

In the Amazon Polly console, select Australian English from the language dropdown and enter following text in the Input text box and then click on Listen to test the pronunciation.

I’m wishing you all a very Happy Mātariki.

Sample speech without applying phonetic pronunciation:

If you hear the sample speech above, you can notice that the pronunciation of Mātariki – a word which is not part of Australian English – isn’t quite spot-on. Now, let’s look at how in such scenarios we can use phonetic pronunciation using SSML tag to customize the speech produced by Amazon Polly.

To use SSML tags, turn ON the SSML option in Amazon Polly console. Then copy and paste following SSML script containing phonetic pronunciation for Mātariki specified inside the ph attribute of the tag.

I’m wishing you all a very Happy Mātariki.

With the tag, Amazon Polly uses the pronunciation specified by the ph attribute instead of the standard pronunciation associated by default with the language used by the selected voice.

Sample speech after applying phonetic pronunciation:

If you hear the sample sound, you’ll notice that we opted for a different pronunciation for some of vowels (e.g., ā) to make Amazon Polly synthesize the sounds that are closer to the correct pronunciation. Now you might have a question, how do I generate the phonetic transcription “” for the word Mātariki?

You can create phonetic transcriptions by referring to the Phoneme and Viseme tables for the supported languages. In the example above we have used the phonemes for Australian English.

Amazon Polly offers support in two phonetic alphabets: IPA and X-Sampa. Benefit of X-Sampa is that they are standard ASCII characters, so it is easier to type the phonetic transcription with a normal keyboard. You can use either of IPA or X-Sampa to generate your transcriptions, but make sure to stay consistent with your choice, especially when you use a lexicon file which we’ll cover in the next section.

Each phoneme in the phoneme table represents a speech sound. The bolded letters in the “Example” column of the Phoneme/Viseme table in the Australian English page linked above represent the part of the word the “Phoneme” corresponds to. For example, the phoneme /j/ represents the sound that an Australian English speaker makes when pronouncing the letter “y” in “yes.”

Customize pronunciation using lexicons

Phoneme tags are suitable for one-off situations to customize isolated cases, but these are not scalable. If you process huge volume of text, managed by different editors and reviewers, we recommend using lexicons. Using lexicons, you can achieve consistency in adding custom pronunciations and simultaneously reduce manual effort of inserting phoneme tags into the script.

A good practice is that after you test the custom pronunciation on the Amazon Polly console using the tag, you create a library of customized pronunciations using lexicons. Once lexicons file is uploaded, Amazon Polly will automatically apply phonetic pronunciations specified in the lexicons file and eliminate the need to manually provide a tag.

Create a lexicon file

A lexicon file contains the mapping between words and their phonetic pronunciations. Pronunciation Lexicon Specification (PLS) is a W3C recommendation for specifying interoperable pronunciation information. The following is an example PLS document:

Matariki Mātariki NZ New Zealand

Make sure that you use correct value for the xml:lang field. Use en-AU if you’re uploading the lexicon file to use with the Amazon Polly Australian English voice. For a complete list of supported languages, refer to Languages Supported by Amazon Polly.

To specify a custom pronunciation, you need to add a element which is a container for a lexical entry with one or more element and one or more pronunciation information provided inside element.

The element contains the text describing the orthography of the element. You can use a element to specify the word whose pronunciation you want to customize. You can add multiple elements to specify all word variations, for example with or without macrons. The element is case-sensitive, and during speech synthesis Amazon Polly string matches the words inside your script that you’re converting to speech. If a match is found, it uses the element, which describes how the is pronounced to generate phonetic transcription.

You can also use for commonly used abbreviations. In the preceding example of a lexicon file, NZ is used as an alias for New Zealand. This means that whenever Amazon Polly comes across “NZ” (with matching case) in the body of the text, it’ll read those two letters as “New Zealand”.

For more information on lexicon file format, see Pronunciation Lexicon Specification (PLS) Version 1.0 on the W3C website.

You can save a lexicon file with as a .pls or .xml file before uploading it to Amazon Polly.

Upload and apply the lexicon file

Upload your lexicon file to Amazon Polly using the following instructions:

  1. On the Amazon Polly console, choose Lexicons in the navigation pane.
  2. Choose Upload lexicon.
  3. Enter a name for the lexicon and then choose a lexicon file.
  4. Choose the file to upload.
  5. Choose Upload lexicon.

If a lexicon by the same name (whether a .pls or .xml file) already exists, uploading the lexicon overwrites the existing lexicon.

Now you can apply the lexicon to customize pronunciation.

  1. Choose Text-to-Speech in the navigation pane.
  2. Expand Additional settings.
  3. Turn on Customize pronunciation.
  4. Choose the lexicon on the drop-down menu.

You can also choose Upload lexicon to upload a new lexicon file (or a new version).

It’s a good practice to version control the lexicon file in a source code repository. Keeping the custom pronunciations in a lexicon file ensures that you can consistently refer to phonetic pronunciations for certain words across the organization. Also, keep in mind the pronunciation lexicon limits mentioned on Quotas in Amazon Polly page.

Test the pronunciation after applying the lexicon

Let’s perform quick test using “Wishing all my listeners in NZ, a very Happy Mātariki” as the input text.

We can compare the audio files before and after applying the lexicon.

Before applying the lexicon:

After applying the lexicon:


In this post, we discussed how you can customize pronunciations of commonly used acronyms or words not found in the selected language in Amazon Polly. You can use SSML tag which is great for inserting one-off customizations or testing purposes. We recommend using Lexicon to create a consistent set of pronunciations for frequently used words across your organization. This enables your content writers to spend time on writing instead of the tedious task of adding phonetic pronunciations in the script repetitively. You can try this in your AWS account on the Amazon Polly console.

Summary of resources

About the Authors

Ratan Kumar is a Solutions Architect based out of Auckland, New Zealand. He works with large enterprise customers helping them design and build secure, cost-effective, and reliable internet scale applications using the AWS cloud. He is passionate about technology and likes sharing knowledge through blog posts and twitch sessions.

Maciek Tegi is a Principal Audio Designer and a Product Manager for Polly Brand Voices. He has worked in professional capacity in the tech industry, movies, commercials and game localization. In 2013, he was the first audio engineer hired to the Alexa Text-To- Speech team. Maciek was involved in releasing 12 Alexa TTS voices across different countries, over 20 Polly voices, and 4 Alexa celebrity voices. Maciek is a triathlete, and an avid acoustic guitar player.


Continue Reading


AWS Week in Review – May 16, 2022

This post is part of our Week in Review series. Check back each week for a quick roundup of interesting news and announcements from AWS! I had been on the road for the last five weeks and attended many of the AWS Summits in Europe. It was great to talk to so many of you…




This post is part of our Week in Review series. Check back each week for a quick roundup of interesting news and announcements from AWS!

I had been on the road for the last five weeks and attended many of the AWS Summits in Europe. It was great to talk to so many of you in person. The Serverless Developer Advocates are going around many of the AWS Summits with the Serverlesspresso booth. If you attend an event that has the booth, say “Hi ” to my colleagues, and have a coffee while asking all your serverless questions. You can find all the upcoming AWS Summits in the events section at the end of this post.

Last week’s launches
Here are some launches that got my attention during the previous week.

AWS Step Functions announced a new console experience to debug your state machine executions – Now you can opt-in to the new console experience of Step Functions, which makes it easier to analyze, debug, and optimize Standard Workflows. The new page allows you to inspect executions using three different views: graph, table, and event view, and add many new features to enhance the navigation and analysis of the executions. To learn about all the features and how to use them, read Ben’s blog post.

Example on how the Graph View looks

Example on how the Graph View looks

AWS Lambda now supports Node.js 16.x runtime – Now you can start using the Node.js 16 runtime when you create a new function or update your existing functions to use it. You can also use the new container image base that supports this runtime. To learn more about this launch, check Dan’s blog post.

AWS Amplify announces its Android library designed for Kotlin – The Amplify Android library has been rewritten for Kotlin, and now it is available in preview. This new library provides better debugging capacities and visibility into underlying state management. And it is also using the new AWS SDK for Kotlin that was released last year in preview. Read the What’s New post for more information.

Three new APIs for batch data retrieval in AWS IoT SiteWise – With this new launch AWS IoT SiteWise now supports batch data retrieval from multiple asset properties. The new APIs allow you to retrieve current values, historical values, and aggregated values. Read the What’s New post to learn how you can start using the new APIs.

AWS Secrets Manager now publishes secret usage metrics to Amazon CloudWatch – This launch is very useful to see the number of secrets in your account and set alarms for any unexpected increase or decrease in the number of secrets. Read the documentation on Monitoring Secrets Manager with Amazon CloudWatch for more information.

For a full list of AWS announcements, be sure to keep an eye on the What’s New at AWS page.

Other AWS News
Some other launches and news that you may have missed:

IBM signed a deal with AWS to offer its software portfolio as a service on AWS. This allows customers using AWS to access IBM software for automation, data and artificial intelligence, and security that is built on Red Hat OpenShift Service on AWS.

Podcast Charlas Técnicas de AWS – If you understand Spanish, this podcast is for you. Podcast Charlas Técnicas is one of the official AWS podcasts in Spanish. This week’s episode introduces you to Amazon DynamoDB and shares stories on how different customers use this database service. You can listen to all the episodes directly from your favorite podcast app or the podcast web page.

AWS Open Source News and Updates – Ricardo Sueiras, my colleague from the AWS Developer Relation team, runs this newsletter. It brings you all the latest open-source projects, posts, and more. Read edition #112 here.

Upcoming AWS Events
It’s AWS Summits season and here are some virtual and in-person events that might be close to you:

You can register for re:MARS to get fresh ideas on topics such as machine learning, automation, robotics, and space. The conference will be in person in Las Vegas, June 21–24.

That’s all for this week. Check back next Monday for another Week in Review!

— Marcia


Continue Reading


Personalize your machine translation results by using fuzzy matching with Amazon Translate

A person’s vernacular is part of the characteristics that make them unique. There are often countless different ways to express one specific idea. When a firm communicates with their customers, it’s critical that the message is delivered in a way that best represents the information they’re trying to convey. This becomes even more important when…




A person’s vernacular is part of the characteristics that make them unique. There are often countless different ways to express one specific idea. When a firm communicates with their customers, it’s critical that the message is delivered in a way that best represents the information they’re trying to convey. This becomes even more important when it comes to professional language translation. Customers of translation systems and services expect accurate and highly customized outputs. To achieve this, they often reuse previous translation outputs—called translation memory (TM)—and compare them to new input text. In computer-assisted translation, this technique is known as fuzzy matching. The primary function of fuzzy matching is to assist the translator by speeding up the translation process. When an exact match can’t be found in the TM database for the text being translated, translation management systems (TMSs) often have the option to search for a match that is less than exact. Potential matches are provided to the translator as additional input for final translation. Translators who enhance their workflow with machine translation capabilities such as Amazon Translate often expect fuzzy matching data to be used as part of the automated translation solution.

In this post, you learn how to customize output from Amazon Translate according to translation memory fuzzy match quality scores.

Translation Quality Match

The XML Localization Interchange File Format (XLIFF) standard is often used as a data exchange format between TMSs and Amazon Translate. XLIFF files produced by TMSs include source and target text data along with match quality scores based on the available TM. These scores—usually expressed as a percentage—indicate how close the translation memory is to the text being translated.

Some customers with very strict requirements only want machine translation to be used when match quality scores are below a certain threshold. Beyond this threshold, they expect their own translation memory to take precedence. Translators often need to apply these preferences manually either within their TMS or by altering the text data. This flow is illustrated in the following diagram. The machine translation system processes the translation data—text and fuzzy match scores— which is then reviewed and manually edited by translators, based on their desired quality thresholds. Applying thresholds as part of the machine translation step allows you to remove these manual steps, which improves efficiency and optimizes cost.

Machine Translation Review Flow

Figure 1: Machine Translation Review Flow

The solution presented in this post allows you to enforce rules based on match quality score thresholds to drive whether a given input text should be machine translated by Amazon Translate or not. When not machine translated, the resulting text is left to the discretion of the translators reviewing the final output.

Solution Architecture

The solution architecture illustrated in Figure 2 leverages the following services:

  • Amazon Simple Storage Service – Amazon S3 buckets contain the following content:
    • Fuzzy match threshold configuration files
    • Source text to be translated
    • Amazon Translate input and output data locations
  • AWS Systems Manager – We use Parameter Store parameters to store match quality threshold configuration values
  • AWS Lambda – We use two Lambda functions:
    • One function preprocesses the quality match threshold configuration files and persists the data into Parameter Store
    • One function automatically creates the asynchronous translation jobs
  • Amazon Simple Queue Service – An Amazon SQS queue triggers the translation flow as a result of new files coming into the source bucket

Solution Architecture Diagram

Figure 2: Solution Architecture

You first set up quality thresholds for your translation jobs by editing a configuration file and uploading it into the fuzzy match threshold configuration S3 bucket. The following is a sample configuration in CSV format. We chose CSV for simplicity, although you can use any format. Each line represents a threshold to be applied to either a specific translation job or as a default value to any job.

default, 75 SourceMT-Test, 80

The specifications of the configuration file are as follows:

  • Column 1 should be populated with the name of the XLIFF file—without extension—provided to the Amazon Translate job as input data.
  • Column 2 should be populated with the quality match percentage threshold. For any score below this value, machine translation is used.
  • For all XLIFF files whose name doesn’t match any name listed in the configuration file, the default threshold is used—the line with the keyword default set in Column 1.

Auto-generated parameter in Systems Manager Parameter Store

Figure 3: Auto-generated parameter in Systems Manager Parameter Store

When a new file is uploaded, Amazon S3 triggers the Lambda function in charge of processing the parameters. This function reads and stores the threshold parameters into Parameter Store for future usage. Using Parameter Store avoids performing redundant Amazon S3 GET requests each time a new translation job is initiated. The sample configuration file produces the parameter tags shown in the following screenshot.

The job initialization Lambda function uses these parameters to preprocess the data prior to invoking Amazon Translate. We use an English-to-Spanish translation XLIFF input file, as shown in the following code. It contains the initial text to be translated, broken down into what is referred to as segments, represented in the source tags.

Consent Form CONSENT FORM FORMULARIO DE CONSENTIMIENTO Screening Visit: Screening Visit Selección

The source text has been pre-matched with the translation memory beforehand. The data contains potential translation alternatives—represented as tags—alongside a match quality attribute, expressed as a percentage. The business rule is as follows:

  • Segments received with alternative translations and a match quality below the threshold are untouched or empty. This signals to Amazon Translate that they must be translated.
  • Segments received with alternative translations with a match quality above the threshold are pre-populated with the suggested target text. Amazon Translate skips those segments.

Let’s assume the quality match threshold configured for this job is 80%. The first segment with 99% match quality isn’t machine translated, whereas the second segment is, because its match quality is below the defined threshold. In this configuration, Amazon Translate produces the following output:

Consent Form FORMULARIO DE CONSENTIMIENTO CONSENT FORM FORMULARIO DE CONSENTIMIENTO Screening Visit: Visita de selección Screening Visit Selección

In the second segment, Amazon Translate overwrites the target text initially suggested (Selección) with a higher quality translation: Visita de selección.

One possible extension to this use case could be to reuse the translated output and create our own translation memory. Amazon Translate supports customization of machine translation using translation memory thanks to the parallel data feature. Text segments previously machine translated due to their initial low-quality score could then be reused in new translation projects.

In the following sections, we walk you through the process of deploying and testing this solution. You use AWS CloudFormation scripts and data samples to launch an asynchronous translation job personalized with a configurable quality match threshold.


For this walkthrough, you must have an AWS account. If you don’t have an account yet, you can create and activate one.

Launch AWS CloudFormation stack

  1. Choose Launch Stack:
  2. For Stack name, enter a name.
  3. For ConfigBucketName, enter the S3 bucket containing the threshold configuration files.
  4. For ParameterStoreRoot, enter the root path of the parameters created by the parameters processing Lambda function.
  5. For QueueName, enter the SQS queue that you create to post new file notifications from the source bucket to the job initialization Lambda function. This is the function that reads the configuration file.
  6. For SourceBucketName, enter the S3 bucket containing the XLIFF files to be translated. If you prefer to use a preexisting bucket, you need to change the value of the CreateSourceBucket parameter to No.
  7. For WorkingBucketName, enter the S3 bucket Amazon Translate uses for input and output data.
  8. Choose Next.

    Figure 4: CloudFormation stack details

  9. Optionally on the Stack Options page, add key names and values for the tags you may want to assign to the resources about to be created.
  10. Choose Next.
  11. On the Review page, select I acknowledge that this template might cause AWS CloudFormation to create IAM resources.
  12. Review the other settings, then choose Create stack.

AWS CloudFormation takes several minutes to create the resources on your behalf. You can watch the progress on the Events tab on the AWS CloudFormation console. When the stack has been created, you can see a CREATE_COMPLETE message in the Status column on the Overview tab.

Test the solution

Let’s go through a simple example.

  1. Download the following sample data.
  2. Unzip the content.

There should be two files: an .xlf file in XLIFF format, and a threshold configuration file with .cfg as the extension. The following is an excerpt of the XLIFF file.

English to French sample file extract

Figure 5: English to French sample file extract

  1. On the Amazon S3 console, upload the quality threshold configuration file into the configuration bucket you specified earlier.

The value set for test_En_to_Fr is 75%. You should be able to see the parameters on the Systems Manager console in the Parameter Store section.

  1. Still on the Amazon S3 console, upload the .xlf file into the S3 bucket you configured as source. Make sure the file is under a folder named translate (for example, /translate/test_En_to_Fr.xlf).

This starts the translation flow.

  1. Open the Amazon Translate console.

A new job should appear with a status of In Progress.

Auto-generated parameter in Systems Manager Parameter Store

Figure 6: In progress translation jobs on Amazon Translate console

  1. Once the job is complete, click into the job’s link and consult the output. All segments should have been translated.

All segments should have been translated. In the translated XLIFF file, look for segments with additional attributes named lscustom:match-quality, as shown in the following screenshot. These custom attributes identify segments where suggested translation was retained based on score.

Custom attributes identifying segments where suggested translation was retained based on score

Figure 7: Custom attributes identifying segments where suggested translation was retained based on score

These were derived from the translation memory according to the quality threshold. All other segments were machine translated.

You have now deployed and tested an automated asynchronous translation job assistant that enforces configurable translation memory match quality thresholds. Great job!


If you deployed the solution into your account, don’t forget to delete the CloudFormation stack to avoid any unexpected cost. You need to empty the S3 buckets manually beforehand.


In this post, you learned how to customize your Amazon Translate translation jobs based on standard XLIFF fuzzy matching quality metrics. With this solution, you can greatly reduce the manual labor involved in reviewing machine translated text while also optimizing your usage of Amazon Translate. You can also extend the solution with data ingestion automation and workflow orchestration capabilities, as described in Speed Up Translation Jobs with a Fully Automated Translation System Assistant.

About the Authors

Narcisse Zekpa is a Solutions Architect based in Boston. He helps customers in the Northeast U.S. accelerate their adoption of the AWS Cloud, by providing architectural guidelines, design innovative, and scalable solutions. When Narcisse is not building, he enjoys spending time with his family, traveling, cooking, and playing basketball.

Dimitri Restaino is a Solutions Architect at AWS, based out of Brooklyn, New York. He works primarily with Healthcare and Financial Services companies in the North East, helping to design innovative and creative solutions to best serve their customers. Coming from a software development background, he is excited by the new possibilities that serverless technology can bring to the world. Outside of work, he loves to hike and explore the NYC food scene.


Continue Reading


Copyright © 2021 Today's Digital.