Lesson 2 - Interacting with Alexa¶
Time Estimate: 90 minutes
Introduction and Goals¶
Alexa was first launched by Amazon in 2014. It is a smart speaker built with virtual assistant technology to respond to a wake word (in this case, the name “Alexa”) and capable of voice interaction. In 2017, Alexa was able to use third party applications so it could tie into everyday life on Earth such as ordering pizza or playing a radio station. Now, Alexa is being investigated as an option for astronauts to use in space.
When visiting space, travelers need to be able to personalize their AI to their own particular requests. The Good Morning Space tutorial guides you through the basic steps in creating a new Alexa skill. You will also explore bias that could exist within the world of speech recognition.
(Teacher Tube version)
Learning Objectives: I will learn to
Language Objectives: I will be able to
How Does Speech Recognition Work
In the previous lesson, you learned that Alexa uses speech recognition and speech synthesis to provide interactivity through voice. As a reminder, speech recognition involves interpreting and carrying out spoken commands.
Optional: If your teacher has an Alexa in the classroom (a physical Alexa, the Alexa phone app, or the Alexa desktop app), try giving Alexa a few commands as input. Alexa will output a different result based on what you tell it. A few recommended inputs are:
- Alexa, tell me a joke.
- Alexa, do you have any pets?
- Alexa, what is the value of pi?
- Alexa, high five!
ACTIVITY: Understanding Alexa Dialogue
Before you build out an Alexa skill, review this example of an Alexa Dialogue to get familiar with the interaction with Alexa in the tutorial. Here are some key words you should know for Alexa’s voice interaction using App Inventor:
- Wake word - a phrase that causes the device to begin recording a user's request so it can be sent for processing.
- Skill - a set of commands or questions that you can program to use with Alexa
- Skill name (also called an invocation) - the phrase a user will speak to indicate to Alexa that they want to use your skill
- Intent - the name of a command or question in your program (think of this like a variable or procedure name -- it’s not seen by the user, only the programmer)
- Utterance - the command or question a user will speak to trigger a specific action as part of the skill
Tutorial: Good Morning, Space!
Now let’s build out an Alexa skill. Get together with a partner - we will be using Pair Programming to complete this program. To get started, open Alexa’s App Inventor and login with your Google account. Follow along with your teacher or the video tutorial to create the Good Morning Space Alexa Skill. Or, if you prefer, you can use the text version of the tutorial.
Watch this brief video. What do you notice? What do you wonder?
While comical, this video illustrates one pitfall of using voice activated AI.
Can an algorithm be biased? Yes, even though computers are machines, they are not free from the intentional or unintentional bias of the people who program them and the input data generated by humans.
Computing innovations can reflect existing human biases because of biases written into the algorithms at all levels of software development or biases in the data used by the innovation. Machine learning and data mining have enabled innovation in medicine, business, and science, but information discovered in this way could be biased depending on the data source and the information can also be used to discriminate against groups of individuals. Programmers need to take action to reduce bias in algorithms used for computing innovations as a way of combating existing human biases.
Watch this video to learn more about algorithmic bias.
Algorithmic bias describes systematic errors in a computer system that create unfair outcomes, due to the algorithm design or how the data used by the program is collected or used to train the algorithm.
Five Types of Algorithmic Bias
- The data reflects an existing bias in society. For example, an image search for nurses may return more female nurses than male nurses.
- The training data is biased or incomplete. For example, facial recognition algorithms that are trained on photos of mostly white faces may not work as well for other skin colors.
- The data is oversimplified into quantitative values. The data may be too complicated to measure so simpler quantitative measures are used that may cause bias, for example counting the sentence length as an oversimplified measure of good writing.
- Data can be affected by a feedback loop. If biased data is fed back into the algorithm that then generates new data, it causes a feedback loop of more biased data. For example, predictive policing software may recommend an increased police presence in neighborhoods based on previous arrests, ignoring other neighborhoods, but this could form a feedback loop where the increased police presence leads to more arrests and more bias in the decision.
- Data can be manipulated. In 2016 Microsoft launched the virtual assistant Tay. People on Twitter bombarded Tay with racist comments and soon many of the responses were racist in nature. Microsoft pulled the plug on Tay after 24 hours.
ACTIVITY: Algorithmic Bias
In this activity, you will investigate the bias present in speech recognition from different perspectives. Open the Bias Activity worksheet. This can be completed either with a partner or on your own. Once finished, your teacher will lead a class discussion based on your findings.
In this lesson, you learned how to:
- Some background information about the evolution of Alexa
- Speech Recognition in AI
- Dealing with Bias in Artificial Intelligence
- What does Google know about you - investigate your own background info
- Hello World is very commonly the first program that any programmer learns how to write! While the program you made for this lesson is modified for our space theme, you can find out more about the origins of Hello, World here.
- Coded Bias Movie
- Your self-driving robotaxi is almost here
Here is a table of the technical terms we've introduced in this lesson. Hover over the terms to review the definitions.
Check Your Understanding
Complete the following self-check exercises. Please note that you should login if you want your answers saved and scored. In addition, some of these exercises will not work in Internet Explorer or Edge browsers. We recommend using Chrome.
Reflection: For Your Portfolio¶
Answer the following portfolio reflection questions as directed by your instructor. Questions are also available in this Google Doc where you may use File/Make a Copy to make your own editable copy.