Before you begin
- Labs create a Google Cloud project and resources for a fixed time
- Labs have a time limit and no pause feature. If you end the lab, you'll have to restart from the beginning.
- On the top left of your screen, click Start lab to begin
Create an API key
/ 25
Make an entity analysis request and call Natural Language API
/ 25
Create a Speech API request and call Speech API
/ 25
Sentiment analysis with the Natural Language API
/ 25
Create an API key
/ 25
Make an entity analysis request and call Natural Language API
/ 25
Create a Speech API request and call Speech API
/ 25
Sentiment analysis with the Natural Language API
/ 25
In a challenge lab you’re given a scenario and a set of tasks. Instead of following step-by-step instructions, you will use the skills learned from the labs in the course to figure out how to complete the tasks on your own! An automated scoring system (shown on this page) will provide feedback on whether you have completed your tasks correctly.
When you take a challenge lab, you will not be taught new Google Cloud concepts. You are expected to extend your learned skills, like changing default values and reading and researching error messages to fix your own mistakes.
To score 100% you must successfully complete all tasks within the time period!
Read these instructions. Labs are timed and you cannot pause them. The timer, which starts when you click Start Lab, shows how long Google Cloud resources are made available to you.
This hands-on lab lets you do the lab activities in a real cloud environment, not in a simulation or demo environment. It does so by giving you new, temporary credentials you use to sign in and access Google Cloud for the duration of the lab.
To complete this lab, you need:
You are starting your career as a junior cloud architect. In this role, you have been assigned to work on a team project that requires you to use the Cloud Natural Language API and Cloud Speech API services in Google Cloud.
You are expected to have the skills and knowledge to complete the tasks that follow.
For this challenge, you are asked to analyze text and speech using the Cloud Natural Language API and Cloud Speech-to-Text API, respectively. You also need to perform sentiment analysis on a text document using Python in Google Cloud Shell.
You need to:
Each task is described in detail below. Good luck!
In the Google Cloud console, navigate to Navigation menu > APIs & Services > Credentials.
Click Create Credentials at the top of the screen and select API key.
Save the generated API key to an environment variable in Cloud Shell:
Click Check my progress to verify the objective.
In the Google Cloud console, click Activate Cloud Shell (>_).
Set your Google Cloud Project ID and Storage bucket environment variables:
Next, create a JSON file named nl_request.json which you will pass to the Natural Language API for analysis. You can add the following code to your JSON file to analyze text about the city of Boston or, alternatively, add text of your own choosing to the content object to perform entity analysis on that instead.
curl command:Click Check my progress to verify the objective.
gs://cloud-samples-tests/speech/brooklyn.flac.
Listen to the audio file before sending it to the Speech API.
speech_request.json for this task, and configure it with the URI of the sample audio file in Cloud Storage:curl:Click Check my progress to verify the objective.
For this task, you need to analyze text sentiment using the Google Cloud Natural Language API client library in Python, which determines the overall attitude (positive or negative) of a content sample such as a movie review.
In Cloud Shell, copy the starter Python application script sentiment_analysis.py from your Cloud Storage bucket:
Download the fictitious movie review samples from Google Cloud Storage and extract the archive:
Open sentiment_analysis.py in your preferred editor (or Cloud Shell Editor) and complete the analyze(movie_review_filename) function using Python:
LanguageServiceClient instance.Document object with the file's text content.client.analyze_sentiment with the document and print the results with print_result(response).Run your sentiment analysis on reviews/bladerunner-pos.txt and save the output:
Upload the sentiment analysis response to your Cloud Storage bucket:
Click Check my progress to verify the objective.
You have successfully performed entity and sentiment analysis on text as well as speech using the Natural Language and Speech APIs.
...helps you make the most of Google Cloud technologies. Our classes include technical skills and best practices to help you get up to speed quickly and continue your learning journey. We offer fundamental to advanced level training, with on-demand, live, and virtual options to suit your busy schedule. Certifications help you validate and prove your skill and expertise in Google Cloud technologies.
Manual Last Updated October 19, 2026
Lab Last Tested October 19, 2026
Copyright 2026 Google LLC. All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.
This content is not currently available
We can notify you via email when it becomes available
Great!
We can contact you via email if it becomes available
One lab at a time
Confirm to end all existing labs and start this one