Integrate with Machine Learning APIs: Challenge Lab | Qwiklabs

In this Challenge Lab you are given a scenario and a set of tasks. You then use what you learned in the Machine learning APIs Quest to figure out how to complete it on your own within the time provided! An automated scoring system (shown on this page) provides feedback on whether you completed your tasks correctly.

To score 100% you must complete all tasks within the time period!

Topics tested

Challenge scenario

You have started a new role as a member of the Analytics team for Jooli Inc. You are expected to help with the development and assessment of data sets for your company's Machine Learning projects. Common tasks include preparing, cleaning, and analyzing diverse data sets.

You are expected to have the skills and knowledge for these tasks, so don't expect step-by-step guides to be provided.

Your challenge

You have been asked to develop a process to analyze sets of images of signage to extract and translate any text in the images. This extracted text information will be used to help classify the images as part of a machine learning project that will use this image dataset for model training and evaluation. The images all contain text, but the text may be in any language. The images are stored in a Cloud Storage bucket that has been provided for you.

You must use a Python script to process each of the image files by sending them to the Google Vision API to identify the text in the image. The text from each image must be saved back to files on Cloud Storage, with a separate file for the text from each image. If the text locale is not English (locale='en'), you must then send the text to the Google Translate API to get an English translation for the original text. Once all of the images have been processed, the script must upload the results to a BigQuery table.

This diagram outlines the process:

https://cdn.qwiklabs.com/kycp4xbmAC9zE7Eufr48Q31ubz7DvPFfoYCIEIMBgAs%3D

The processed text data must then be written out to a pre-existing BigQuery table called image_text_detail in a dataset in your project called image_classification_dataset.

A colleague on your team had started to work on the code to process the images based on a Python script previously used to process a set of text files using the Natural Language API. Your colleague has been moved to a separate project and you must now complete the task.